Lisp/code request to make block text display viewport scale.

Lisp/code request to make block text display viewport scale.

Jonathan.Gray68UQW
Enthusiast Enthusiast
1,356 Views
3 Replies
Message 1 of 4

Lisp/code request to make block text display viewport scale.

Jonathan.Gray68UQW
Enthusiast
Enthusiast

Hey all!

 

I have a request for some help if some kind soul would be willing to give me a hand. I had previously posted my original question over in the other AutoCAD forum at this link https://forums.autodesk.com/t5/autocad-forum/auto-updating-text-based-on-viewport-scale/td-p/8983764  but the answers I received told me that the default options in Autocad does not allow for this, so I thought I would seek help here :). 

 

I am needing help with getting text within a block to display a viewport scale that I want to "assign" the block to. Our workflow is to first create a viewport in layout space and then insert a block of a bar scale from the tool palette. What I need, if possible, is a lisp/routine that allows me to insert the blocked bar scale, then select the viewport I want my bar scale to be linked to so that the text on my bar scale will auto-update as I change the zoom level of the viewport?  Is this possible? 

 

I am including a pic of my bar scale block. 

0 Likes
1,357 Views
3 Replies
Replies (3)
Message 2 of 4

scot-65
Advisor
Advisor
Perhaps a start?
The only item I can think of is to try and find what you
are looking for using the function DUMPALLPROPERTIES
and selecting the viewport.

I'm not well versed in VL items to provide an answer using
this approach... someone can chime in...

What I question is the block will require two text objects
inside to adjust; that is if the block is static?

What happens if the viewport scale is "between scales"?

???

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

0 Likes
Message 3 of 4

Jonathan.Gray68UQW
Enthusiast
Enthusiast

Thank you very much for your suggestions! Hopefully, somebody way smarter than me can take that info and is able to help me out.  As a side note, I can't believe I am the first person to ever basically request this... 🙂 

0 Likes
Message 4 of 4

ronjonp
Mentor
Mentor

Assuming your barscale has attributes, you could use Lee's quick field code to populate them. Then you'd have a link.

0 Likes