Community
Civil 3D Forum
Welcome to Autodesk’s Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Custom Barscale Block

12 REPLIES 12
Reply
Message 1 of 13
Anonymous
627 Views, 12 Replies

Custom Barscale Block

So the goal is to create a dynamic bar scale in the opposite way that the built in bars work. Rather than have the bar resize with the scale of the viewport, we have a bar that is a set width (with 1/4" increments) and want the numbers to change based on the scale of the viewport. It sounds a little strange but IMO the way the current scales work is a little convoluded.

 

Here's what we're going for:

Make a block with increments, have the 1" increment be the vp scale (therefore printing as 1:vpscale). This can either be accomplished by clicking on the viewport or by making a manually editable attribute, I'm not picky. The next however many increments will be multiples of that first entry.

 

Here's what we've tried:

  1. Make a block with 1 attribute and fields that have formulas as multiples of the attribute. This requires putting a field within a field.
  2. Instead of entering the vpscale manually, select the vp, then again allow fields to handle the multiples.

 

Here are the problems:

  1. When you update the value of the attribute (in paper space) the attributes don't change - they're taking the value of the attribute in it's state in the block editor aka the default value. If you bring all the fields out of the block and into paper space they all update correctly (albeit after an "updatefield") but they're no longer part of the block, so whenever you move the bar scale you have to select all the objects. And before you say "Just Group Them", if you group them, then you can't double click to edit the attribute. Those 2 steps combine hardly make it worth the effort, plus my colleagues will inevitably forget how it works and not use it.
  2. The field expression that shows up after you select a vpscale is 1:vpscale, the increments on the barscale should just be the vpscale, no ratio. This method should fix the incorrect reference problem (default value vs paper space value) from before but I can't figure out how to get just the vpscale in the field formula. And I also don't know how to make the viewport selectable upon block insertion.

All these attempts are predicated on the fact that I just don't have time to write any code. 

Any takers?

12 REPLIES 12
Message 2 of 13
ToddRogers-WPM
in reply to: Anonymous

Here is one I created...

Todd Rogers
Message 3 of 13
tcorey
in reply to: Anonymous

The problem I see is that you are adding the fields as mtext objects. Add them with Attdef, add a field value as the default value, and be sure sure sure you check the box next to Preset in the attdef dialog. If you don't check Preset, it won't work.

 

Tim

 



Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut
Message 4 of 13
rl_jackson
in reply to: tcorey

Here's on I created that's dynamic.


Rick Jackson
Survey CAD Technician VI

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 5 of 13
Joe-Bouza
in reply to: Anonymous

This isnt automated but may work for you.

 

 

Joe Bouza
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 6 of 13
rl_jackson
in reply to: Joe-Bouza

Well its seems that all Scale Blocks are pretty much the same LOLSmiley Very Happy


Rick Jackson
Survey CAD Technician VI

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 7 of 13
stacy.dunn
in reply to: Anonymous

We use a block with attributes for this.  The attributes contain a field that uses the customscale value of a viewport that is linked by a macro.  The result is a bar scale that has values that change with the zoom height of the viewport.

 

the formula would be  1/customscale

 

field code where the number is the objectID of the viewport you are linking to:

 

%<\AcExpr (1/%<\AcObjProp Object(%<\_ObjId 8796086946384>%).CustomScale \f "%lu2%qf2816">%) \f "%lu2%pr0">%

 

 

This is a basic example.  We have also leveraged this method to link to profile or section views and display their vertical scale as well.  But that requires more code.

 

The attached drawing contains a viewport that is linked to the bar scale and will update on a regen when the zoom height is changed.

 

 

Stacy

Stacy Dunn
Message 8 of 13
doni49
in reply to: Anonymous

Here's ours the bar doesn't change and it uses visibility states to change scales.

 

 



Don Ireland
Engineering Design Technician




If a reply solves your issue, please remember to click on "Accept as Solution". This will help other users looking to solve a similar issue. Thank you.


Please do not send a PM asking for assistance. That's what the forums are for. This allows everyone to benefit from the question asked and the answers given.

Message 9 of 13
Anonymous
in reply to: stacy.dunn

I just thought about the 1/customscale yesterday. Thanks for the heads up.

Message 10 of 13
Anonymous
in reply to: Anonymous

Wow everyone, thanks for your input. I'll let you know if anyone's is gonna work for us after I get a chance to run through them all.

Message 11 of 13
jmayo-EE
in reply to: Anonymous

Yeah I'm gonna thank everyone too. I now have a library of dyn scales instead of one. 🙂

John Mayo

EESignature

Message 12 of 13
Joe-Bouza
in reply to: jmayo-EE

Yeah! And we are over a month ahead of the "Harvest Moon" 🙂

Joe Bouza
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 13 of 13
Anonymous
in reply to: Joe-Bouza

Hey everyone,

 

After a little tinkering with the suggestions I actually got ours to work (checking preset does change some things) with 1 caveat. I won't go into specifics but the gist is that you have to redefine the fields after you're out of the block. This brings us to the caveat: You have to copy this scale bar for it to work. If you try to insert the block the fields will reference the default again. If someone can figure out how to make the block work from scratch, feel free to do so. File's attached.

 

PS The fields will update on "regen", "save", "updatefield", etc

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report