Releasing "Vision_5" toolbar

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
freedman
Veteran
Posts: 3475
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Releasing "Vision_5" toolbar

Post by freedman »

The macro is here:
https://github.com/Freedman-CB1/Macro-Vision

For some Youtube views, watch these in 1080p:
https://www.youtube.com/channel/UCcnFnZ ... VEHjhkzHkw

For some .mp4 videos:
https://github.com/Freedman-CB1/Vision_5_Videos

Directions for use:
https://github.com/Freedman-CB1/Macro-Vision/wiki

Updated macro on github, Sept. 18 2020


All feedback is welcome, especially if you can find code problems, I'm new to python.
Attachments
Vision_5_toolbar_image.PNG
Vision_5_toolbar_image.PNG (7.87 KiB) Viewed 2529 times
Last edited by freedman on Fri Mar 05, 2021 11:55 pm, edited 20 times in total.
User avatar
bavariaSHAPE
Posts: 406
Joined: Tue Jun 10, 2014 8:31 am
Contact:

Re: Releasing "Vision_5" toolbar

Post by bavariaSHAPE »

When I start Vision 5, I get the following error:

Code: Select all

20:19:24  C:\…\FreeCAD_0.19_x64_LP_12.1.2_PY3QT5-WinVS2015\Mod\Show\SceneDetails\Workbench.py(43)<class 'SyntaxError'>: ('invalid syntax', ('C:/…/AppData/Roaming/FreeCAD/Macro/Vision5_V55.FCMacro', 6, 1, '<!DOCTYPE html>\n'))

Any idea?

OS: Windows 7 SP 1 (6.1) (Without internet connection)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22284 (Git)
Build type: Release
Branch: master
Hash: bf1e8e48389f5e9e25bd77b67fe98da4213e797c
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
… for a happy FreeCAD-World … JM2C …
freedman
Veteran
Posts: 3475
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Releasing "Vision_5" toolbar

Post by freedman »

I should have said: do a new macro create and copy the macro code into it.

The reason I wanted to do github was to track changes.
I will post the macro code here until I make a change on github and then I will remove it here permanent. This will make it easier for now.

And I have no idea about that error.
Thanks
Last edited by freedman on Thu Sep 10, 2020 5:52 am, edited 1 time in total.
User avatar
bavariaSHAPE
Posts: 406
Joined: Tue Jun 10, 2014 8:31 am
Contact:

Re: Releasing "Vision_5" toolbar

Post by bavariaSHAPE »

freedman wrote: Sat Aug 29, 2020 7:36 pm I should have said: do a new macro create and copy the macro code into it.

The reason I wanted to do github was to track changes.
I will post the macro code here until I make a change on github and then I will remove it here permanent. This will make it easier for now.

And I have no idea about that error.
Thanks
Done, thanks.

My procedure:

Vision_ macro.jpg
Vision_ macro.jpg (17.43 KiB) Viewed 2499 times

So I have the original files in a ZIP file, is also better for archiving.
… for a happy FreeCAD-World … JM2C …
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Releasing "Vision_5" toolbar

Post by vocx »

There is no point in importing every class from QtGui and QtCore, if you are already using the prefixed classes.

Not needed.

Code: Select all

from PySide.QtCore import *
from PySide.QtGui import *
This is enough.

Code: Select all

from PySide import QtCore
from PySide import QtGui

QtGui.QWidget()
QtGui.QVBoxLayout()
Using the str() function is pointless because TypeId is already a string.

Code: Select all

if str(obj.TypeId) != "Part::Helix":
This is enough.

Code: Select all

if obj.TypeId != "Part::Helix":
Please don't use semi-colons, it's bad Python style.

Code: Select all

self.editor_list[0][0].setEnabled(True) ; self.editor_list[1][0].setEnabled(True) ; self.editor_list[2][0].setEnabled(True) ; self.editor_list[3][0].setEnabled(True) ; self.global_list[3][0].setEnabled(True)
Better.

Code: Select all

self.editor_list[0][0].setEnabled(True)
self.editor_list[1][0].setEnabled(True)
self.editor_list[2][0].setEnabled(True)
self.editor_list[3][0].setEnabled(True)
self.global_list[3][0].setEnabled(True)
This could actually be handled with a loop.

Code: Select all

for i in range(4):
    self.editor_list[i][0].setEnabled(True)
Also, I don't recommend using big try-except blocks.

Code: Select all

try:
    # 50 lines
except:
    pass
This is a way to quickly avoid errors in your code, however it's not the best solution.

You should trap specific errors, not just trap all errors to quickly avoid problems.

Code: Select all

try:
    self.pad2 = self.pad.getParentGeoFeatureGroup()     
except:
    self.pad2 = None

if not self.pad2:
    return

# 50 lines
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
freedman
Veteran
Posts: 3475
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Releasing "Vision_5" toolbar

Post by freedman »

Thanks vocx, I will get those changes incorporated.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Releasing "Vision_5" toolbar

Post by Kunda1 »

freedman wrote: Fri Aug 28, 2020 6:46 pm I will work on some videos and getting this in the addon manager. I will also work on docs.
Would you mind making a screencast demoing the usage of the macro ?
Thanks!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
freedman
Veteran
Posts: 3475
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Releasing "Vision_5" toolbar

Post by freedman »

Is there a file size limit to a video, like mp3, does the 1 meg limit still apply?
Thanks
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Releasing "Vision_5" toolbar

Post by Kunda1 »

freedman wrote: Fri Sep 04, 2020 7:53 am Is there a file size limit to a video, like mp3, does the 1 meg limit still apply?
Yes, attachment limits apply across the board. You can always upload to imagur or even your github repo
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
freedman
Veteran
Posts: 3475
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Releasing "Vision_5" toolbar

Post by freedman »

Videos.....

Video1: Using Global and Single selections and see what they do to the model. A Global selection affects the entire model and single selections are mouse select only. You will need to exit Single selection mode to edit model lines and edges. There are many combinations to choose from. https://github.com/Freedman-CB1/Vision_ ... Video1.mp4

Video2: Using Page edit mode on page #1, using suppress vs wireframe, selecting all objects in a Part container vs single object and enter/exit Page edit. https://github.com/Freedman-CB1/Vision_ ... Video2.mp4

Video3: Using Page edit mode on page #1 we set the Part edit and go about clicking on objects. In about 5 click almost the entire model is set for hidden and we hide it. Then we go about randomly selecting parts for unhiding. Then we see how object edit can give us easy access to looking inside a model. We can select between Part and Object selection at any time.
At the end we see how wire framed objects can be shown in the model. https://github.com/Freedman-CB1/Vision_ ... Video3.mp4

Video4: Using page edit we use multiple pages as we work our way down thru layers to see inside. Objects selected on the current page are hidden in the next page (increasing page number). This allows us to keep some object always hidden as we work. The page numbers can be changed in edit or view mode but the control points are only visible in edit mode. The model will be stored as you see it so when you open the file the macro can used to edit. https://github.com/Freedman-CB1/Vision_ ... Video4.mp4

Video5: Shows the Edit-Sketcher-Display-Preferences that I use, you might want it a little different but I recommend these settings. Notice I turn off "Restore cameras position" so when we use "3D view sketch" button the view won't get changed after an edit. The video shows "3D view sketch" enabled so as sketches are opened the view stays as is. Selecting "Inventor" allows us to rotate the view while a sketch is opened. You will need to switch back from Inventor to restore the mouse to normal operation in Gesture mode. The video continues on to show how Page Edit can be used to hide objects and open sketches to edit and rotate the view while in Sketcher. https://github.com/Freedman-CB1/Vision_ ... Video5.mp4

Video6: Selecting "Color all" to change to color of all objects. This will override all color so watch out if you preset colors. We also see how "Focus tree" will keep the tree in view after a sketch edit. Notice how we open multiple sketches without a view change because we have "3D view sketch" enabled. https://github.com/Freedman-CB1/Vision_ ... Video6.mp4

Video7: Shows page mode and how we navigate back and forth using the page editor.https://github.com/Freedman-CB1/Vision_ ... Video7.mp4
Post Reply