New macro "Vision4" for Part and PartDesign

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
freedman
Posts: 1451
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

New macro "Vision4" for Part and PartDesign

Postby freedman » Wed May 13, 2020 12:09 am

I've had previous versions of my Vision macros. Please see the link below for good general directions on usage.
https://forum.freecadweb.org/viewtopic. ... 50#p395258

The latest version will always be on the first post.
Attachments
screen_view.JPG
screen_view.JPG (26.43 KiB) Viewed 287 times
Last edited by freedman on Thu Jun 11, 2020 4:06 am, edited 13 times in total.
freedman
Posts: 1451
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: New macro "Vision4" for PartDesign

Postby freedman » Wed May 13, 2020 9:48 pm

Deleted
Last edited by freedman on Mon Jun 01, 2020 7:55 pm, edited 1 time in total.
freedman
Posts: 1451
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: New macro "Vision4" for PartDesign

Postby freedman » Sat May 16, 2020 7:14 pm

Updating to Vision4_4.FCMacro

PROBLEM: Pick setting of Vis=5 was setting to zero instead of five. Fixed.

Macro is in first post.
freedman
Posts: 1451
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: New macro "Vision4" for PartDesign

Postby freedman » Mon May 18, 2020 9:08 pm

deleted
Last edited by freedman on Mon Jun 01, 2020 7:55 pm, edited 2 times in total.
triplus
Posts: 9464
Joined: Mon Dec 12, 2011 4:45 pm

Re: New macro "Vision4" for PartDesign

Postby triplus » Mon May 18, 2020 9:59 pm

Thanks for creating and sharing the macro.
freedman
Posts: 1451
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: New macro "Vision4" for PartDesign

Postby freedman » Mon Jun 01, 2020 6:58 pm

I have some very new concepts for FreeCAD productivity thru visual means. I'm pretty jacked about this, we can mouse select any
object and any object under it, total control without using space bar.

For the Part users, yes it works in Part. I think now the floating toolbar is the best approach, the buttons can be selected with minimal mouse movement and my future plan is to make it collapsible to get better screen usage. Maybe this is the best tool for the job.

For the folks that are unsure about using macros, the only things my vision macros target is to automate would you could do by changing the properties by hand. Try to change the transparencies of an entire model by hand and you will soon see the power of writing code.
The macro will change point size from 1 to 12 and back, it also makes the point color identical to the shape color, minimal changes at best.

Lets talk about working issues.
Modeling with one or two objects is currently easy to do but once the model gets complicated the fun of using the program really tapers off. I spend/spent most of my time moving the mouse around trying to find stuff, this is what my macro is supposed to fix. I'm not faulting anyone, this is the road FreeCAD is on.

To make the 3D view screen work for us we need to be able to reference objects and keep them in the working view. Once the space bar is used to hide an object we violated the programs intentions. We are here to see and work in 3D not the current concept of hide stuff so you can work on other stuff and then try to remember what you hid and what it's called in the tree.

I probably would have done the same thing as the developers in the past, it seems like a good idea to use the spacebar to hide objects but in retrospect (always 20/20) it has made for years of building models and then using the space bar to whisk parts away just to do some work.
I specifically targeted the space bar as a tool that should be used rarely, but how to do that. I'll show you!

The new improved vision4 has 6 buttons under "Vision Pick" to do advanced viewing. I added a selection observer to take over mouse selection when any of the 6 buttons are turned on, when turned on the macro background will turn Red. The buttons are On/Off in normal usage but the macro will also set all buttons to off if anything is selected in the tree.

Usage of the 6 buttons in the Pick area:
The first three buttons 100,50,10 set transparencies, the procedure would be to select one of the 3 buttons (macro background will change to red)
and then go to the model and select one or multiple objects by faces or edges, the transparency will change immediately, once finished click the set transparency button again to turn off, the macro background will changed back to light blue. That's simple enough.

The next button "hide/show" is not so simple. First, the button below it is an option button that works to set either wireframe or points, this button is a toggle. The hide/show when turned on will allow you to click on one or multiple objects to perform the change.

Here is the method behind hide/show; an object has pretty much 2 states when it comes to viewing and selection. It's either solid which means you can select it by face or if it's wireframe/points then you can't select a face, you would need to use an edge or vertex. I exploit this difference by selecting and toggling these two states as you work.

My mental process to develop the macro went like this:
I need to select a part behind a part; so change the part in front to wireframe so you can select thru it.
I need to change the part back to solid; then make the part selection toggle between wireframe/points and solid.
I need to see thru complicated parts with lots of lines; then use points instead of wireframe, this opens the view.
I need to see the points; then make them bigger so you can see them and use them to select later.
I need to identify wireframe objects and they are hard to click on; set their points to a larger size to use as selection points later.
I have a bunch of points on the screen and I don't know which to select; set the point color to the object color and color your objects.
I need a quick way to return all my objects to solid; make a button to do just that "unhide all".

The attached pic, I copied the left motor and pasted the copy on the right, then went to work on the right one with the macros help. Twenty mouse clicks later I am inside looking at the rod journals. The cool thing about this is that I can stay inside this engine and change solids to wireframes and look around and never go to the tree or touch the space bar. Some will say the points are in the way but once you zoom in they are of little distraction (second pic).
The correct file is Vision4_v5.FCMacro.
Attachments
Dual_motor_inside.JPG
Dual_motor_inside.JPG (201.34 KiB) Viewed 312 times
Dual_zoomed.JPG
Dual_zoomed.JPG (199.01 KiB) Viewed 312 times
freedman
Posts: 1451
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: New macro "Vision4" for Part and PartDesign

Postby freedman » Wed Jun 10, 2020 5:38 am

Made an upgrade to Vision4, now Vision4_v7: I needed this option to bring in a bunch of STL files and they all came in grey and I had no idea what connected to what :). I added an additional button to the Vision toolbar to color all objects a different color. See the pics; the original at left and on the right (after one button click) you can see all the objects in their glory. This is also fun, every time you click the button all the colors change. 8-)

This is very useful to understand the imported model, you get an immediate sense of the models bones.

Updated to; Vision4_v7
Attachments
show1.JPG
show1.JPG (177.93 KiB) Viewed 178 times
Extrude_pic.JPG
Extrude_pic.JPG (147.79 KiB) Viewed 178 times
Last edited by freedman on Thu Jun 11, 2020 4:04 am, edited 1 time in total.
User avatar
Kunda1
Posts: 7546
Joined: Thu Jan 05, 2017 9:03 pm

Re: New macro "Vision4" for Part and PartDesign

Postby Kunda1 » Wed Jun 10, 2020 11:22 am

Would you consider adding this macro to github and using a versioning system, that way we can follow the coding progress? We can also then figure out how to integrate it into the Addon Manager.
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
freedman
Posts: 1451
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: New macro "Vision4" for Part and PartDesign

Postby freedman » Wed Jun 10, 2020 2:21 pm

Kunda1, I will do that next. I always presumed this macro would be a temporary thing (being new to python) but now I think my code is readable enough to get feedback from real python programmers :). I finally feel like the macro adds something to FreeCAD so I will learn to Git stuff.

It's great to be able to write a macro to suite ones own needs and run it in FreeCAD. Thanks all!
User avatar
Kunda1
Posts: 7546
Joined: Thu Jan 05, 2017 9:03 pm

Re: New macro "Vision4" for Part and PartDesign

Postby Kunda1 » Wed Jun 10, 2020 3:00 pm

freedman wrote:
Wed Jun 10, 2020 2:21 pm
I finally feel like the macro adds something to FreeCAD so I will learn to Git stuff.
Nice!
Checkout our wiki page: Github for how to get started
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features