hdmcclx Posted April 18 Share Posted April 18 Hi All. Let me premise by saying i am completely new to trying to make my own plugins or doing any scripting! Ive done a bunch of searching and playing around and i think im slowly getting where i need to but figured it wouldnt hurt to reach out to try speed up the process. All i am trying to make is a very basic tool that inserts a specified symbol (Essentially just like the insert symbol tool) However i then want to have some controllable options from the OIP. I can get a basic script to do the Symbol insertion. I can get a basic tool with editable things in the OIP. (but no symbol) However i cant make it so the Symbol is a PIO with settings editible in the OIP. Hope that makes sense! Quote Link to comment
JBenghiat Posted April 18 Share Posted April 18 You seem to be describing a Plug In Object. PIOs will create their own insertion tool, with the interface for a point PIO being very similar to the symbol insertion tool. The script component for a simple PIO should draw the elements you want to display, with the origin of the scripted elements being the insertion point of the object (like a symbol definition). Your script can insert a symbol at the origin. You can also code all the geometry of the elements you want to draw, and it will appear symbol-like to the user. 1 Quote Link to comment
hdmcclx Posted April 18 Author Share Posted April 18 10 hours ago, JBenghiat said: You seem to be describing a Plug In Object. PIOs will create their own insertion tool, with the interface for a point PIO being very similar to the symbol insertion tool. The script component for a simple PIO should draw the elements you want to display, with the origin of the scripted elements being the insertion point of the object (like a symbol definition). Your script can insert a symbol at the origin. You can also code all the geometry of the elements you want to draw, and it will appear symbol-like to the user. Is there an example of a script to insert a symbol? Ive found several for drawing an object but none to insert a symbol Quote Link to comment
JBenghiat Posted April 18 Share Posted April 18 The symbol insertion code is a one liner: https://developer.vectorworks.net/index.php?title=VS:Symbol You would ultimately want to do some error checks to make sure the named object exists and is of type symbol definition. Quote Link to comment
hdmcclx Posted April 19 Author Share Posted April 19 28 minutes ago, JBenghiat said: The symbol insertion code is a one liner: https://developer.vectorworks.net/index.php?title=VS:Symbol You would ultimately want to do some error checks to make sure the named object exists and is of type symbol definition. Cool! So how do i put that into a script that will run? Apologies; as i said at the start i have zero scripting experience Quote Link to comment
JBenghiat Posted April 22 Share Posted April 22 You said you were able to create a PIO with parameter in the OIP. Place this line in the script of the PIO: Symbol('symbolName', 0, 0, 0); This will place the symbol symbolName at the center of the PIO, facing up. 1 Quote Link to comment
Sam Jones Posted April 22 Share Posted April 22 1 minute ago, JBenghiat said: This will place the symbol symbolName at the center of the PIO, facing up. Actually, it will place the symbol at the insertion point of the PIO. The insertion point is where you click when you place the PIO. If you want to offset the symbol from where you click, put the amount of offset in the Symbol() call as measured from the click. 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.