spettitt Posted August 30, 2023 Share Posted August 30, 2023 I'm trying to script the creation of multiple sheet layers based on the number of a certain type of object in the drawing, which will be presented one-per-sheet. I can create empty sheet layers fine, but can't yet add the title block. I have a named TBB style in the file. Should the vs.Symbol function work even though it is a styled PIO? For someone new to scripting, the Symbol function seems minimally documented. Does anyone have a simple example script that could show it working please? Particularly, I'm confused about the number of arguments, and how to present ptx and pty as a single argument. I tried to use (name, 0, 0, 0) but got the error there were too many arguments. Curious how the x/y pt is presented as a single argument - or maybe it's not! Thank you Quote Link to comment
Pat Stanford Posted August 30, 2023 Share Posted August 30, 2023 Symbol will not work with PIOs. Either put the TBB inside a "Blue" symbol (Convert to Group option selection in Insertion Options) Or use vs.CreateCustomObjectN with an object name of 'Title Block Border' 2 Quote Link to comment
spettitt Posted August 30, 2023 Author Share Posted August 30, 2023 Thanks Pat. CreateCustomObjectN works perfectly, and I like that method better, so that's me sorted. I think that function will get used a lot! But tonight I can now iterate through making a sheet, adding a title block, setting the style, adding a SLVP and setting the sheet title. Happy with that. 2 Quote Link to comment
Juliensv Posted September 12, 2023 Share Posted September 12, 2023 On 8/30/2023 at 2:00 PM, spettitt said: Curious how the x/y pt is presented as a single argument - or maybe it's not! To answer this part of the question, usually this means the x/y is presented to the function as a tuple, like (x,y). A tuple in python basically just an immutable list of values, that can be passed into a function as a variable just like a list or integer of anything. So your code would look something like this: symbolName = "mySymbol" p = (x,y) rotationangle = 180 vs.Symbol(symbolName, p, rotationAngle Quote Link to comment
spettitt Posted September 16, 2023 Author Share Posted September 16, 2023 On 9/12/2023 at 5:06 PM, Juliensv said: To answer this part of the question, usually this means the x/y is presented to the function as a tuple, like (x,y). A tuple in python basically just an immutable list of values, that can be passed into a function as a variable just like a list or integer of anything. So your code would look something like this: symbolName = "mySymbol" p = (x,y) rotationangle = 180 vs.Symbol(symbolName, p, rotationAngle Sorry, this one slipped through the net and I forgot to reply. Thank you! A tuple does make sense now. I've read up on packing and unpacking them and I get it. 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.