Search found 66 matches

by xianyu
Wed Dec 27, 2023 6:52 am
Forum: Open discussion
Topic: Invalid after saving and reopening the model
Replies: 4
Views: 404

Re: Invalid after saving and reopening the model

Lamgok6 wrote: Tue Dec 26, 2023 9:30 am ...
Thank you for your professional explanation Lamgok6. I will make modifications according to your plan.

Roy_043 wrote: Tue Dec 26, 2023 9:50 am Check ...\Mod\Draft\draftobjects\ for some examples.
Thank you for your example Roy_043, I will study it carefully.
by xianyu
Thu Dec 21, 2023 9:38 am
Forum: Open discussion
Topic: Invalid after saving and reopening the model
Replies: 4
Views: 404

Re: Invalid after saving and reopening the model

I looked at other workbench such as "Curves". It is found that the author only puts FreeCAD built-in functions such as "addProperty" in the "__init__" function, and puts all his own functions in "execute". Their model can also achieve functionality when saved ...
by xianyu
Thu Dec 21, 2023 9:14 am
Forum: Open discussion
Topic: Invalid after saving and reopening the model
Replies: 4
Views: 404

Invalid after saving and reopening the model

Hi I made a simple Python workbench with some commands to create 3D models. All the commands work. When I saved this model (. FCStd) and opened the saved file to continue working, I found an error message saying "<class' AttributeError '>:' LenSurface 'object has no attribute' oSystem '" A...
by xianyu
Fri Aug 04, 2023 1:31 am
Forum: Python scripting and macros
Topic: After creating a new document, default loading settings
Replies: 2
Views: 373

Re: After creating a new document, default loading settings

sounds like you want to limit yourself to a single "action" to create new doc and prefill that doc with some objects. in that case your single action should not be to "create new doc", but rather a macro (which you can have as a button in a toolbar), with that macro you can crea...
by xianyu
Thu Aug 03, 2023 3:10 am
Forum: Python scripting and macros
Topic: After creating a new document, default loading settings
Replies: 2
Views: 373

After creating a new document, default loading settings

Hi~
I have some system settings that need to be loaded.
Select a custom workbench, after clicking the New document button, without clicking the toolbar button, is there a way to load some Settings (or objects) in the tree by default?
by xianyu
Thu Jun 08, 2023 8:28 am
Forum: Python scripting and macros
Topic: Surface lofting to form a cylinder
Replies: 0
Views: 1766

Surface lofting to form a cylinder

Hi~ I made two surfaces, generated by the following code. I want to extract the edges of these two surfaces and use the lofting command to generate a cylinder. What should I do? points = [Vector(0,0,0), ......] surface = Part.BSplineSurface() surface.approximate(points) surface.setVPeriodic() obj.Sh...
by xianyu
Fri May 26, 2023 6:40 am
Forum: Python scripting and macros
Topic: Double click to open the tasks panel and edit mode
Replies: 1
Views: 356

Double click to open the tasks panel and edit mode

Hello~ Is there any information or threads to guide me to learn? Double-click the mouse to open the tasks panel and edit mode.I want to implement the same functionality and design other UI dialogs. For example, in the Part workbench , double clicking on an object in the tree view will open the tasks...
by xianyu
Tue May 23, 2023 6:21 am
Forum: Python scripting and macros
Topic: [Solved]command button is clickable under certain conditions
Replies: 2
Views: 627

Re: command button is clickable under certain conditions

marioalexis wrote: Mon May 22, 2023 7:53 pm You can use the Gui.CommandAction descriptor class.
Here is an example of how you can use it: https://github.com/FreeCAD/FreeCAD/pull/9171
Thank you, marioalexis. I think I found a solution
by xianyu
Mon May 22, 2023 9:04 am
Forum: Python scripting and macros
Topic: [Solved]command button is clickable under certain conditions
Replies: 2
Views: 627

[Solved]command button is clickable under certain conditions

Hi~ I created three command buttons in the toolbar. I want to achieve this when I click on the first and second buttons. The third button can be clicked (by default, it cannot be clicked, the icon is gray). I plan to write code for IsActive () on the third button, but I realize that the IsActive fun...
by xianyu
Wed Mar 08, 2023 9:53 am
Forum: Python scripting and macros
Topic: [Solved]Line perpendicular to face
Replies: 4
Views: 479

Re: Line perpendicular to face

Thank you, onekk and mario52. I used Macro Rotate To Point.The compound rotates around the center of gravity. https://wiki.freecad.org/Macro_Rotate_To_Point Macro_WorkFeatures https://wiki.freecad.org/images/thumb/9/9d/WF_wf.png/32px-WF_wf.png your goal and many other (Besides, I know this for the f...