TheSwamp

CAD Forums => CAD General => Dynamic Blocks => Topic started by: bdough15 on April 25, 2012, 11:14:53 AM

Title: Associating a block to viewport scale
Post by: bdough15 on April 25, 2012, 11:14:53 AM
I have had a request from an Engineer in my office to create a scale block that associates directly to the Viewport Scale.  That way we "never" have a problem with the scale block being incorrect again.  Our Current Scale Block is older and has been brought forward for years, it is a basic attributed block.  Does anyone have any suggestions as to how would create a block that would link directly to the viewport scale?
Title: Re: Associating a block to viewport scale
Post by: Jeff H on April 25, 2012, 12:07:04 PM
I have done through code where you create a scale block with visibility states to match different scales, and when the viewport is modified it.
 
This was just simple example http://www.theswamp.org/index.php?topic=38480.0 (http://www.theswamp.org/index.php?topic=38480.0)
Title: Re: Associating a block to viewport scale
Post by: ronjonp on April 25, 2012, 02:03:17 PM
You can give this a try as well. Uses fields in an attributed block. The precision is controlled by the luprec variable.
Title: Re: Associating a block to viewport scale
Post by: alanjt on April 25, 2012, 05:09:20 PM
You can give this a try as well. Uses fields in an attributed block. The precision is controlled by the luprec variable.
Very nice.  :kewl:
Title: Re: Associating a block to viewport scale
Post by: ronjonp on April 25, 2012, 10:19:05 PM
Thanks Alan. It was fun to write ... I may even adapt it for my own use  :-)
Title: Re: Associating a block to viewport scale
Post by: huiz on April 26, 2012, 03:32:29 AM
In Civil3D 2013 and Map3D 2013 there is standard functionality to have scale bars, but also north arrows chained to viewports.
Title: Re: Associating a block to viewport scale
Post by: bdough15 on April 26, 2012, 10:37:01 AM
So then really I should just wait a few weeks and use the functionality in C3D 2013.  I think that is the best way to go, don't reinvent the wheel on a clients time.
Title: Re: Associating a block to viewport scale
Post by: ronjonp on April 26, 2012, 11:09:13 AM
So then really I should just wait a few weeks and use the functionality in C3D 2013.  I think that is the best way to go, don't reinvent the wheel on a clients time.

But you did not reinvent the wheel, I did  :roll: so no "clients" time has been used.  :-P I guess it will be a good tool for non Civil3D users.