Search found 254 matches
- Fri Apr 12, 2024 1:54 am
- Forum: Python scripting and macros
- Topic: How to use App::PropertyColorList
- Replies: 7
- Views: 535
Re: How to use App::PropertyColorList
What I have said about the name is not correct. I was playing around and at some point checked the "Show all" option in the Tree view context menu. Apparently ColorList properties are hidden by default. Maybe because the average user would have a hard time editing such a property. The nam...
- Thu Apr 11, 2024 6:36 pm
- Forum: Python scripting and macros
- Topic: How to use App::PropertyColorList
- Replies: 7
- Views: 535
Re: How to use App::PropertyColorList
the property wont appear under "Animation" Remove the underscore from the property name. still an empty list after append. obj.addProperty("App::PropertyColorList", "SolidColors", "Animation", "list of colors for each solid") obj.SolidColors += [(1,...
- Thu Apr 11, 2024 2:13 pm
- Forum: Python scripting and macros
- Topic: How to use App::PropertyColorList
- Replies: 7
- Views: 535
How to use App::PropertyColorList
Hello. Im trying to add a list of colors to a scripted object but when I do: obj.addProperty("App::PropertyColorList", "solid_colors", "Animation", "list of colors for each solid") the property wont appear under "Animation". The property is created t...
- Sat Apr 06, 2024 5:19 pm
- Forum: Open discussion
- Topic: MBDYN workbench
- Replies: 2
- Views: 503
Re: MBDYN workbench
Hello. It depends on what you want the marker for. If you would like to create a joint, you do not need to create the markers as these are added while the joint is created. Simply click on the joint and then select reference geometries from the two bodies you would like to connect. The markers are a...
- Fri Apr 05, 2024 1:59 am
- Forum: Python scripting and macros
- Topic: Setting the view properties of the solids in a compound
- Replies: 11
- Views: 862
Re: Setting the view properties of the solids in a compound
import random doc = App.ActiveDocument obj = doc.Compound transparency = 0.2 newcolors = [] for solid in obj.Shape.Solids: color = (random.uniform(0,1),random.uniform(0,1),random.uniform(0,1), transparency) for face in solid.Faces: newcolors.append(color) obj.ViewObject.DiffuseColor = newcolors Thi...
- Thu Apr 04, 2024 7:41 pm
- Forum: Open discussion
- Topic: MBDYN
- Replies: 7
- Views: 1136
Re: MBDYN
Hi. Have a look at the latest version of my FreeCAD-MBDyn "Motion Workbench". It is now a nice assembly workbench as well as a MbD software. Yes, yet another assembly workbench, but hopefully from the video you will be convinced it is quite a powerful one! You can download the model (all t...
- Thu Apr 04, 2024 7:40 pm
- Forum: FEM
- Topic: FreeCAD as pre-post processor for MBDyn
- Replies: 437
- Views: 176330
Re: FreeCAD as pre-post processor for MBDyn
Hi. Have a look at the latest version of my FreeCAD-MBDyn "Motion Workbench". It is now a nice assembly workbench as well as a MbD software. Yes, yet another assembly workbench, but hopefully from the video you will be convinced it is quite a powerful one! You can download the model (all t...
- Thu Apr 04, 2024 4:14 am
- Forum: Python scripting and macros
- Topic: Setting the view properties of the solids in a compound
- Replies: 11
- Views: 862
Re: Setting the view properties of the solids in a compound
That's weird. I thought I'd already posted this - but if I did, it didn't take: import random doc = App.ActiveDocument obj = doc.getObject("ELEMENT_rigid_body_1") shp = obj.Shape solids = shp.Solids transparency = 0.2 colors = [(random.uniform(0,1),random.uniform(0,1),random.uniform(0,1),...
- Thu Apr 04, 2024 3:42 am
- Forum: Python scripting and macros
- Topic: Setting the view properties of the solids in a compound
- Replies: 11
- Views: 862
Re: Setting the view properties of the solids in a compound
Setting the colors of individual faces would also work if I could know to which solid each face belongs. That, I know how to do. solids = shp.Solids for j, face in enumerate(shp.Faces): solid = shp.ancestorsOfType(face, Part.Solid)[0] for i, s in enumerate(solids): if s.isEqual(solid): print(f'Face...
- Wed Apr 03, 2024 11:15 pm
- Forum: Python scripting and macros
- Topic: Setting the view properties of the solids in a compound
- Replies: 11
- Views: 862
Re: Setting the view properties of the solids in a compound
@josegegas obj = doc.getObject("Compound") [x.ViewObject.ShapeColor for x in obj.OutList] lists the shape colors of the compound's contents. This works with compounds made using part boolean operations. My compound is a simple copy of these. When I do: obj = doc.getObject("Compound&q...