I layout a 3 dim drawing of a yagi antenna using draft workbench - In order to model the antenna in NEC software, I need to specify the beginning and end of each wire element as xyz coordinates. I believe a python macro should be able to export the element coordinates to a text file or csv file. I have tried to do so but my ability with Python & Freecad in general is quite limited. Any help will be most appreciated!
Thanks - Joe
Export xyz coordinates
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Export xyz coordinates
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
My macros on Gist.github here complete macros Wiki and forum.
Re: Export xyz coordinates
In the Addon manager there is also WireXYZ which imports, but can easily modified to export:
Pertinent parts of the changed code:
Pertinent parts of the changed code:
Code: Select all
obj = App.getDocument(docname).getObject("<<your object name here>>")
outfile = "<<your file name here>>"
file = open(outfile, "w")
for vct in obj.Points:
print(*vct,sep=' ')
X,Y,Z = vct
file.write(' '.join([str(n) for n in vct]))
file.write('\n')
file.close()
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
Re: Export xyz coordinates
Thanks very much for the quick repies & answers - those who devote their time & effort to help others will be blessed!
Thanks again!
Joe
Thanks again!
Joe