Jump to content

Recommended Posts

Posted

Hey!

Everyone was so helpful on my last issue, I was wondering if I could bother the hive mind for another hint:

 

I have a title block which has a city and state as separate attributes. I would like the city and state the be centered with the text above it:

 

Title A

Title B

Title C

CITY STATE

The issue is the "city" and "state" are be separate attributes (It would be trivial if they could be combined into one). I have a bunch of DWG's in which the last line is shifted depending on the length of the city name.

 

I have tried to write an LISP script to detect the length of the city attribute and shift the line accordingly, but I have miserably failed (I'm having difficulty dealing with attributes without VBA knowledge). Any hints or pointers would be extremely appreciated.

 

Thanks for a taking a peak at my problem!

 

Take care,

Seth

 

P.S. I can upload a sample title block if anyone is interested.

 

P.P.S. I thought of some more information:

The state will always be two characters

I'm trying to write a post-processing LISP script (a lot of the drawings have already been created)

Posted

You could change the City & State attributes to be hidden. Then add a 3rd attribute which you place a field to both the hidden attributes' values. Thus turning them into one attribute which updates from the values of the other 2.

 

There's one problem with this though: If you double click on the City/State combined attribute you're editing the field and not the source attributes.

Posted
You could change the City & State attributes to be hidden. Then add a 3rd attribute which you place a field to both the hidden attributes' values. Thus turning them into one attribute which updates from the values of the other 2.

 

There's one problem with this though: If you double click on the City/State combined attribute you're editing the field and not the source attributes.

 

I didn't thank about that at all, that's a great idea. Unfortunately I don't know if I have the artistic license to do that... Thank you for the tip though!

Posted

You're welcome. If you're not allowed to edit the TB's definition, then are you allowed to move attributes about only on inserted references of that definition?

 

If so then it "might" be possible to adjust this through Lisp. There's quite a few threads pertaining to attribute adjustment. I think the main problem is figuring out the lengths of the attributes' values as displayed. The "simplest" way would probably be by getting the bounding box through ActiveX - though I've not tested bounding box on an Attribute before. That should give you a unit length which you could add together + a gap in between and adjust to suit your TB's placement. Usually a TB wouldn't be rotated / scaled / mirrored / ucs'ed, so you needn't worry about that headache.

Posted

The title blocks were not made in house, so I'm leaning towards tweaking them as little as possible.

 

I think that your ActiveX suggestion is the way to go, I'm wrestling with it as we speak. I think I'm going to need to learn a lot more Visual LISP to pull it off though, haha.

 

I think the way to go is to store the raw coordinates for each case (there are only four title blocks and three cities) and just brute force it.

 

Until then, I can keep eyeballing it manually, :). Thank you again for your time and help!

-Seth

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...