Jump to content

Inserting Title Block Border


Recommended Posts

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

Link to comment

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.

  • Like 2
Link to comment
  • 2 weeks later...
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

 

Link to comment
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.

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...