Viewport scale as annotative text/Mtext

Viewport scale as annotative text/Mtext

jyan2000
Advocate Advocate
1,510 Views
7 Replies
Message 1 of 8

Viewport scale as annotative text/Mtext

jyan2000
Advocate
Advocate

Hello everyone,

Is there any lisp that auto updates Viewport scale as annotative text/Mtext ? 

Regards 

Vic

0 Likes
1,511 Views
7 Replies
Replies (7)
Message 2 of 8

dbroad
Mentor
Mentor

Use an object field in paper space that references a paper space viewport and reports the scale.

Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 3 of 8

dennis
Advisor
Advisor

Based on the screen shot, I can't tell if your callout is in Model Space or on the Layout.  Either way, natural function of Fields would work without the overhead of a Lisp routine.

If the callout is on the Layout tab, then easy enough just to place the block (with attribute) or text (mtext or dtext) onto the Layout and then associate the Field by Object, selecting the Viewport and assigning the Scale.

If the callout is in model space, then follow the same steps above, but then use the CHSPACE command to shift it over into model space.  The link below covers this process in reverse, but will work either way.

 

Regens and other actions will update the Field when the scale of the Viewport changes.  Those settings can be found in Options/ User Preferences / Field Update Settings

 

https://forums.autodesk.com/t5/autocad-forum/tagging-model-objects-in-layout/td-p/4840959

 

Please feel free to clarify the question if this is amiss.

0 Likes
Message 4 of 8

jyan2000
Advocate
Advocate

Thank you very much Dennis and dbroad for the quick reply. Viewport scale associated the Field by Object does work well on Papaerspace. However, question was how to link Layout scale as a text/Mtext in MODELspace. 

 

Regards

 

Victor

 

0 Likes
Message 5 of 8

dennis
Advisor
Advisor

I answered that in my post as well.  You will have to first create the field in paperspace, then use the CHSPACE command to move the text containing the Field to model space.

0 Likes
Message 6 of 8

dbroad
Mentor
Mentor

There was no mention of that in your OP and your picture showed a picture of a layout tab.  How were we supposed to know that that meant the field was supposed to be in modelspace? However, a chspace command is all that is needed as has been mentioned.

Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 7 of 8

jyan2000
Advocate
Advocate

Thank you very much for ur replies dbroad and Dennis.  Viewport scale associated the Field by Object works well by  Dennis' guidance. 

1st to link text with  Field Object on PaperSpace

2nd CHSPACE sent text to ModelSpace. 

But, I may insist to have an Autocad LISP file to pass those steps in a single command as LeeMac's MidLenV1-1.lsp ( attached ). Its look similar coding. but i'm not that smart to write codes. 😞  . That's why I'm looking for help. 

 

Best Regards

Vic

0 Likes
Message 8 of 8

dennis
Advisor
Advisor

Regardless, using an AutoLISP routine or the Action Recorder, you will need to select the viewport because it will always be unique.  I still see that this doesn't need automation.  And by the way, this site is to assist people in writing their own code when they get stuck, it isn't a site to get code written for free.

0 Likes