is there objects inspection tool?

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: is there objects inspection tool?

Post by TheMarkster »

onekk wrote: Tue Jan 18, 2022 7:48 am
In theory you could even color different even edges, but maybe this is more challenging, as if it works like faces, you have to generate a color tuple for every egde and change only desired ones.
Colorize macro does this and vertices, too.
User avatar
onekk
Veteran
Posts: 6098
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: is there objects inspection tool?

Post by onekk »

TheMarkster wrote: Tue Jan 18, 2022 8:19 pm Colorize macro does this and vertices, too.
Yes I know this, it was only a comment about direct use of the methods exposed by FreeCAD, if you are using this in your own code, and the way an ipotetic useful feature will have to be. :)

Indeed a look of the way "colorize macro" will do such things will be an interesting reading (for coders).

My intention was more general, but in the discussion there are some but:

- How stable is the View part of FreeCAD (and the ViewObject part of DocumentObjects), there are around some talking about some modification in the code to make the "Viasualization part" of FreeCAD more "performant". (RealThunder was doing some experimenting with a "new renderer")

- How much overhead it will ad, if the code has to prepare and put in the "DocumentObject" a different "color value" for every Element, (Face, Edges, maybe Vertexes)

- How much users are in "need of" this feature.


And maybe there will be some more, these are the first three that I could think at a first glance.

But this tend to be OT here.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
User avatar
dprojects
Posts: 720
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

Re: is there objects inspection tool?

Post by dprojects »

I have already implemented the edgeband but not commited yet. It works perfect if you don't have multicolor furniture. This return exact selected edge size. However, I still thinking about other things like columns width for multi reports. No matter, I think this part of post is closed but I have to subscribe to this topic if there will be any inspection tool.

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
User avatar
dprojects
Posts: 720
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

Re: is there objects inspection tool?

Post by dprojects »

OK, finally I made inspection tool for FreeCAD macro development. Maybe not so impressive code but works really fine for me. You can check very quickly many interesting things there (edges, faces, constraints). I guess this might be useful and speed up little bit the macro development. I think it is more convenient than writing commands at python console.

Link to the inspection tool: https://github.com/dprojects/scanObjects

Image

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
kisolre
Veteran
Posts: 4159
Joined: Wed Nov 21, 2018 1:13 pm

Re: is there objects inspection tool?

Post by kisolre »

dprojects wrote: Mon Feb 07, 2022 7:44 pm You can check very quickly many interesting things there (edges, faces, constraints)
I really like that. But sometimes it does not properly "go deeper". For example when inspecting Body.ExpressionEngine it does not switch to all those __XXX__ properties and you can not see the docs for append method.

OS: Windows 8.1 Version 6.3 (Build 9600)
Word size of FreeCAD: 64-bit
Version: 0.20.27444 (Git)
Build type: Release
Branch: master
Hash: c282015ceb00901dfa69595b6cbc1f8b9eedaffa
Python version: 3.8.8
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: Bulgarian/Bulgaria (bg_BG)
User avatar
dprojects
Posts: 720
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

Re: is there objects inspection tool?

Post by dprojects »

kisolre wrote: Mon Feb 07, 2022 8:54 pm I really like that. But sometimes it does not properly "go deeper". For example when inspecting Body.ExpressionEngine it does not switch to all those __XXX__ properties and you can not see the docs for append method.
It is obvious it not go everywhere ;-) because FreeCAD structure is very complicated ;-)
There are so many different objects types that is not possible to handle all of them one by one. I would like to make it rather automatic.
However, in some cases this can be improved. I have some improvements ideas too but looking also for feedback to find out what is important for FreeCAD macro developers.

I have no idea what is Body.ExpressionEngine but I will look into that. What kind of object's type is that.

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
kisolre
Veteran
Posts: 4159
Joined: Wed Nov 21, 2018 1:13 pm

Re: is there objects inspection tool?

Post by kisolre »

dprojects wrote: Mon Feb 07, 2022 9:46 pm What kind of object's type is that.
The problem is that if you go deep from there is looks like you do but the object list is not updated and still shows the Body properties. Moving up/down after that does not update the other lists.
Attachments
BodyExpressionEngine1.JPG
BodyExpressionEngine1.JPG (101.41 KiB) Viewed 1343 times
BodyExpressionEngine2.JPG
BodyExpressionEngine2.JPG (53.82 KiB) Viewed 1343 times
User avatar
dprojects
Posts: 720
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

Re: is there objects inspection tool?

Post by dprojects »

I checked the ExpressionEngine and it look empty array.

From tool console:

Code: Select all

10:00:00  <class 'str'>

10:00:05  <body object>
10:00:05  <class 'PartDesign.Body'>

10:00:09  []
10:00:09  <class 'list'>
From the python console:

Code: Select all

>>> FreeCAD.ActiveDocument.getObjectsByLabel("Body")[0].ExpressionEngine
[]
I don't have example with no empty array for that. Have any?

Regarding the problem with widows update ;-) LOL I know that ;-) It is far away from perfect ;-) there is no auto-update code for that, you need to move up and down keys little bit to have all windows updated. There is also another bug, if you go to far or click right arrow many times at something that can't go deeper this will stuck. You have to click several time the left (go back button) ;-) I will look into that how to solve it ;-)

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
User avatar
dprojects
Posts: 720
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

Re: is there objects inspection tool?

Post by dprojects »

I fix it, empty array was added so there was no index for that and it stuck. Also I added the selection path and info about selection and clear all windows after selection. The path is useful to control if there are no double clicks added or empty arrays or any other things that shouldn't be added. Also you can control how deep you already are. This looks good while you go back. So this should be more intuitive now.

If you see any other bugs, or something that could be improved let me know.

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
User avatar
sliptonic
Veteran
Posts: 3453
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: is there objects inspection tool?

Post by sliptonic »

If you go to Path or Draft workbench (Might work in others), you can select something in the tree or the 3D window and right click. In the context menu is a 'send to python console'. This will give you a reference to the document object, shape, and subelement in the console so you can inspect them there.
Post Reply