I discovered the arch survey tool... another nice feature. On the freecad description page about arch survey is also a python script which should do the same thing..but i get no result ...hope someone can help me out.
here the script from the description page about arch survey.
This is my result with arch survey tool..very nice.
And here the result with the script..the console say only run..but no result.(i tried it also with part objects)
Thanks in advanced...maybe someone knows how does it work.
Arch survey and code
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Arch survey and code
I think if run python macro from a file. It can not use 'print' command, it can use in "Python Console" only.
I'm replaced 'Msg' command to report on "Report View" panel.
The result is shown in a figure below.
I'm replaced 'Msg' command to report on "Report View" panel.
The result is shown in a figure below.
Code: Select all
import FreeCADGui
selection = FreeCADGui.Selection.getSelectionEx()
for obj in selection:
for element in obj.SubObjects:
Msg('Area:' + str(element.Area) + '\n')
Msg('Length:' + str(element.Length) + '\n')
Msg('Volume:' + str(element.Volume) + '\n' )
Msg('Center of Mass :' + str(element.CenterOfMass) + '\n' )
Msg('---------------------------------\n')
Re: Arch survey and code
chakkree thanks a lot for your help....I tried the comand also in the python Console but i hit only one time Enter.
With your advice i tried it a second time and hit two times enter to confirm the command and all infos get printed in the Console.
Also a big thanks for your code ..works great. I tried to get also the object NAME or LABEL with the lines in the picture..but as often no luck.
Maybe you can help me again..or someone else.
With your advice i tried it a second time and hit two times enter to confirm the command and all infos get printed in the Console.
Also a big thanks for your code ..works great. I tried to get also the object NAME or LABEL with the lines in the picture..but as often no luck.
Maybe you can help me again..or someone else.
Re: Arch survey and code
Now, I'm not sure.
I'm got code from this, http://www.freecadweb.org/wiki/index.ph ... rch_Survey
and paste to python console, the result as a figure below.
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.7989 (Git)
Build type: Release
Branch: master
Hash: 8051d32adc646a1580d43a38253fd5eddb3932e6
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0
I'm got code from this, http://www.freecadweb.org/wiki/index.ph ... rch_Survey
and paste to python console, the result as a figure below.
Code: Select all
import FreeCADGui
selection = FreeCADGui.Selection.getSelectionEx()
for obj in selection:
for element in obj.SubObjects:
print "Area: ", element.Area
print "Length: ", element.Length
print "Volume: ", element.Volume
print "Center of Mass: ", element.CenterOfMass
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.7989 (Git)
Build type: Release
Branch: master
Hash: 8051d32adc646a1580d43a38253fd5eddb3932e6
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0
Re: Arch survey and code
Can this solve for you?flokart wrote: I tried to get also the object NAME or LABEL with the lines in the picture..but as often no luck.
Maybe you can help me again..or someone else.
Code: Select all
import FreeCADGui
selection = FreeCADGui.Selection.getSelectionEx()
for obj in selection:
Msg('Name:' + str(obj.Object.Name) + '\n')
for obj in selection:
Msg('Label:' + str(obj.Object.Label) + '\n')
Re: Arch survey and code
Thanks again ....yep that solved my problem...it works great.