Editing BlenderBIM Add-on/Using the Python console with BlenderBIM Add-on
From Wiki.OSArch
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 28: | Line 28: | ||
Alternatively, you can write a full script from a text file and run it. Instead of switching to the Python console mode, just switch to the Blender text editor mode, and press the <code>Run Script</code> button in the top right once you've written or loaded a script. You can also press <code>Alt P</code> as a short cut, but your mouse cursor must be over your code when you press the hotkey. | Alternatively, you can write a full script from a text file and run it. Instead of switching to the Python console mode, just switch to the Blender text editor mode, and press the <code>Run Script</code> button in the top right once you've written or loaded a script. You can also press <code>Alt P</code> as a short cut, but your mouse cursor must be over your code when you press the hotkey. | ||
− | The Blender text editor has basic line numbers, syntax highlighting, and line wrapping abilities. | + | The Blender text editor has basic line numbers, syntax highlighting, and line wrapping abilities. On Mac and Linux, the output will be to the console. On Windows, the console may not be visible. To make it visible, go click on <code>Window > Toggle System Console</code>. |
− | To make it visible | ||
− | |||
If you'd like to access the currently loaded or imported IFC file, there is no need to re-open the file with IfcOpenShell. Instead, you can access it as so: | If you'd like to access the currently loaded or imported IFC file, there is no need to re-open the file with IfcOpenShell. Instead, you can access it as so: | ||
<syntaxhighlight lang="python"> | <syntaxhighlight lang="python"> | ||
− | import blenderbim. | + | import blenderbim.bim.ifc |
− | ifc = | + | ifc = blenderbim.bim.ifc.IfcStore().get_file() |
</syntaxhighlight> | </syntaxhighlight> | ||
{{BlenderBIM_Add-on_Documentation}} | {{BlenderBIM_Add-on_Documentation}} | ||
[[Category:Blender]] [[Category:BlenderBIM Add-on]] | [[Category:Blender]] [[Category:BlenderBIM Add-on]] |