Search found 14 matches

by Dorantor
Wed Jul 31, 2019 11:11 pm
Forum: Tutorials and videos
Topic: Cylinder head - Months in the Making
Replies: 15
Views: 3859

Re: Cylinder head - Months in the Making

This looks very cool! Thank you for sharing!
by Dorantor
Wed Jul 31, 2019 11:05 pm
Forum: Tutorials and videos
Topic: video tutorial Create a Workbench
Replies: 14
Views: 4356

Re: video tutorial Create a Workbench

I am trying to develop a workbench but I still have very limited Python skills and (in my humble opinion) the Workbench_creation wiki looks a bit intimidating for someone like me (although I really appreciate the time and effort people have put in this wiki!!). I think some kind of video tutorial co...
by Dorantor
Tue Jul 23, 2019 2:05 pm
Forum: Python scripting and macros
Topic: alternative eval() method
Replies: 8
Views: 677

Re: alternative eval() method

Those sorts of things are usually called "dunder methods", as in "double underscore". Your approach was pretty close. Let's assume the result of input("part name: ") is "Box". Then, getattr(objectname, "Box") would return the same thing as entering objectname.Box , because Box is an attr of objectn...
by Dorantor
Mon Jul 22, 2019 11:59 pm
Forum: Python scripting and macros
Topic: alternative eval() method
Replies: 8
Views: 677

Re: alternative eval() method

Ah I see! I also tried using getattribute but with an other way (something like this): objectname = Gui.ActiveDocument getattr(objectname, input("part name: ")+".Object.Shape.CenterOfMass") But I got an error (probably since I not fully understand the method). You are using something called a 'magic...
by Dorantor
Mon Jul 22, 2019 11:09 pm
Forum: Python scripting and macros
Topic: alternative eval() method
Replies: 8
Views: 677

alternative eval() method

Suppose I want to get the center of mass from a part named by the user. I learned that you can use the eval() method to turn this string into a python command but I also learned that this method is in general a dangerous one since users can implement their own code in this. center = eval("Gui.Active...
by Dorantor
Wed Jul 17, 2019 9:04 pm
Forum: Help on using FreeCAD
Topic: Assembly 2: import part with local point/axis reference
Replies: 6
Views: 326

Re: Assembly 2: import part with local point/axis reference

I've switched to the "Assembly 2 Plus (A2plus)" workbench as the development of this workbench seems more active. This solved my problem, I think.
by Dorantor
Wed Jul 17, 2019 6:41 pm
Forum: FEM
Topic: Modelica
Replies: 36
Views: 8312

Re: Modelica

In the last few months I've picked up a programming tutorial for Python. I'm now trying to make a simple script to import a Freecad Assembly model into OpenModelica as a multibody system. I hope it works and my code will definitely be messy but it would be a nice first step. Maybe in the future I or...
by Dorantor
Tue Jul 16, 2019 6:21 pm
Forum: Help on using FreeCAD
Topic: Assembly 2: import part with local point/axis reference
Replies: 6
Views: 326

Re: Assembly 2: import part with local point/axis reference

OS: Windows 10 Word size of OS: 64-bit Word size of FreeCAD: 64-bit Version: 0.18.16110 (Git) Build type: Release Branch: (HEAD detached at upstream/releases/FreeCAD-0-18) Hash: f7dccfaa909e5b9da26bf50c4a22ccca9bb10c40 Python version: 3.6.6 Qt version: 5.6.2 Coin version: 4.0.0a OCC version: 7.3.0 L...
by Dorantor
Tue Jul 16, 2019 1:24 pm
Forum: Help on using FreeCAD
Topic: Assembly 2: import part with local point/axis reference
Replies: 6
Views: 326

Assembly 2: import part with local point/axis reference

I'm trying to import a part in my assembly which contains a local coordinate system and reference mass point. picture of part: https://imgur.com/a/bd8Qrz5 However, when I try to import it I get an error message saying this: https://imgur.com/a/FIZhByO . Anyone has an idea how to fix this? (using Fre...