Total Pageviews

Tuesday, June 5, 2018

Python Scripting Tool Palette Setup in Plant 3D

I have been asked on occasion how I do my scripting and testing in Plant 3D for the Steel Supports Bundle.  I did this long ago and just carry it over release after release. I created a tool palette called Python Scripting that has several commands that I need during testing.  If you are like me, you never get the code right the first time so you test it, modify the code, test again, modify the code, etc. 

This is my tool palette, and sure, I could make some changes to this to add more tools or combine existing tools into one, or even add some of these commands in the scripts, but I am a creature of habit and I am stuck on this one.  I like it!  It has my Arxpnp3dadapter load, my register scripts command, and then my test script.  I will explain the others later on in this post.


So this tool palette is called PYTHON SCRIPTING.XTP.  After I created my first one way back when in the 2015 release, I right-clicked on the tool palette header, then went to CUSTOMIZE PALETTES...  


It opens the following dialog box and from there, I exported it out to a folder.


Once exported to a folder, I can then import the same way when a new release of Plant 3D comes out, or I have to reinstall my existing P3D.

Now back to the tool palette... 

The Erase-Purge is just a simple set of commands that erases the 3d object that is placed during testing (on 0,0,0).  Yes, I could just close the DWG without saving but saving is also something I have a habit of doing so when I do that by mistake, this is my bailout command to clear it from the drawing and purge it.

The Plant Snap Shot is just the thumbnail creation tool you need when you start adding your scripts to the catalog.

And Plant Part Convert is not really needed with Python Scripting, but I have the command there in my tool palette for when I am having to catalog block based components.


So that is what I use.  If you need to see the actual command syntax behind the buttons, comment on this post and I will be happy to send them to you.