Search found 40 matches

by SBlade
Tue Jan 16, 2024 12:29 pm
Forum: Python scripting and macros
Topic: Create Axis Python Code
Replies: 3
Views: 3055

Re: Create Axis Python Code

Thanks a lot, probably it is very simple but I coulnd't figure it out I need to assign a values iteratively from tableWidget to "dis" list object. Below code works well but for i in range(self.tableWidget.rowCount()-1): x_coord = self.tableWidget.item(i,1).text() x_grid = x_grid + float(x_...
by SBlade
Mon Jan 15, 2024 5:52 am
Forum: Python scripting and macros
Topic: Create Axis Python Code
Replies: 3
Views: 3055

Create Axis Python Code

Dear All I'm creating the axis with following code but created axed is always default ones, where the distances are [0.00, 1000.00, 1000.00, 1000.00, 1000.00] by default where even if I change the distances after creation it doesn't update the view. What am I doing wrong here? import Arch ax = Arch....
by SBlade
Tue Jan 02, 2024 1:25 pm
Forum: Python scripting and macros
Topic: how to create std Part and add objects in it
Replies: 1
Views: 23116

how to create std Part and add objects in it

Dear All, I have following code, where I originally started from code snippets section "Get the normal vector on the surface" and added some codes to modify it but it keeps complaining about the in <module> App.activeDocument().Part.addObject(ex) <class 'TypeError'>: argument 1 must be App...
by SBlade
Tue Aug 08, 2023 5:37 am
Forum: Python scripting and macros
Topic: How to add dents on pillar objects with mouse click
Replies: 2
Views: 428

How to add dents on pillar objects with mouse click

Dear All, I need to achieve the following task: depending on the mouse position on the surface of pillar object I want to add or delete that corresponding dent with scripting . How am I supposed to achieive that ? For the quick clue I checked the source on how the dents are create and it seems that ...
by SBlade
Tue Jul 25, 2023 11:58 pm
Forum: Python scripting and macros
Topic: How to modify and update objects
Replies: 9
Views: 1232

Re: How to modify and update objects

I origianlly started from that example which is in official page, but that was misleading https://wiki.freecad.org/Code_snippets#search=List_the_PropertiesList:~:text=Top-,List%20the%20PropertiesList,-import%20FreeCADGui%0Afrom what is that "o = App.ActiveDocument.ActiveObject" in the foll...
by SBlade
Tue Jul 25, 2023 9:48 am
Forum: Python scripting and macros
Topic: How to modify and update objects
Replies: 9
Views: 1232

Re: How to modify and update objects

here is screenshot with executed script, it is clearly visible that object has a dent but not returned back by property listing

I also post my FC version in OP.
Shot 2023-07-25 124508.png
Shot 2023-07-25 124508.png (103.96 KiB) Viewed 1195 times
by SBlade
Tue Jul 25, 2023 8:52 am
Forum: Python scripting and macros
Topic: How to modify and update objects
Replies: 9
Views: 1232

How to modify and update objects

Dear All, I need to retrieve the object properties of select objects modify and iterate through their properties to change them. import FreeCADGui from FreeCAD import Console o = App.ActiveDocument.ActiveObject op = o.PropertiesList for p in op: Console.PrintMessage("Property: "+ str(p)+ &...
by SBlade
Mon Jul 24, 2023 6:48 am
Forum: Python scripting and macros
Topic: Adding Objects by Python Code doesn't invoke Undo/Redo command
Replies: 3
Views: 447

Adding Objects by Python Code doesn't invoke Undo/Redo command

If I add an object via python code then I noticed that undo / redo command doesn't operate properly, for example take a look at the below code, If I type it in console then oebject is added by undo redo doesnt work. What do I need to do after that it seems that I have to call some commands such as R...
by SBlade
Tue Jul 18, 2023 5:47 am
Forum: Python scripting and macros
Topic: Extract info from GetObjectInfo
Replies: 1
Views: 324

Extract info from GetObjectInfo

Dear All, Very basic question but I couldn't figured it out on my own so your help will be appreciated pos = Gui.ActiveDocument.ActiveView.getCursorPos() info = Gui.ActiveDocument.ActiveView.getObjectInfo(pos) print(getattr(info,'Document')) #Following line gives a error such as : AttributeError: 'd...