South Azimuth setting: System variables

South Azimuth setting: System variables

Anonymous
Not applicable
1,254 Views
4 Replies
Message 1 of 5

South Azimuth setting: System variables

Anonymous
Not applicable

I recently re-figured out how to set my drawing to South azimuth via the drawing settings.  Is there a way I can set this using system variables?  I want to put into my autolisp so that every drawing once opened is set to south azimuth.

0 Likes
1,255 Views
4 Replies
Replies (4)
Message 2 of 5

Jay_B
Mentor
Mentor

I'm not aware of any variable or command that applies to the "Direction: > Measurement type" in Ambient Settings.

 

Running the Command: _ImportStylesAndSettings will set the direction in current dwg using the "source drawing or template" direction settings.

 

Be sure to check the "Import Settings" box on lower left of the _ImportStylesAndSettings dialog.

 

Please be aware, that in certain cases, you may not want all dwg settings overwritten by the _ImportStylesAndSettings command.

C3D 2018.1
C3D 2016 SP4

Win 7 Professional 64 Bit
0 Likes
Message 3 of 5

tcorey
Mentor
Mentor

There is no AutoCAD system variable to set this, but it is settable using VisualLISP. Here is code that will do that. Variables are not localized, but should be. This is just a quick demonstration of how you can do what you're asking. You can eliminate all those lines that dump objects. That's my way of drilling down to find the right property to set.





;set drawing to south azimuth (defun c:go() (vl-load-com) (getdoc) (vlax-dump-object dwgstg t) (setq ambstg (vlax-get-property dwgstg 'AmbientSettings)) (vlax-dump-object ambstg t) (setq dirstg (vlax-get-property ambstg 'DirectionSettings)) (vlax-dump-object dirstg t) (setq meastyp (vlax-get-property dirstg 'MeasurementType)) (vlax-dump-object meastyp t) (vlax-put-property meastyp 'Value 3) (vlax-dump-object meastyp t) );end defun ;-----------------------------------getdoc function--------------------------------------- (defun getdoc () (setq prod (vlax-product-key)) (setq acadapp (vlax-get-acad-object)) (getaecappnumber) (setq c3dapp (vla-getinterfaceobject acadapp (strcat "AeccXUiLand.AeccApplication" aecappno)) ; C3Ddoc (vla-get-activedocument C3Dapp) c3dstg (vlax-get-property c3ddoc 'Settings) dwgstg (vlax-get-property c3dstg 'DrawingSettings) UnZoSetg (vlax-get-property dwgstg 'UnitZoneSettings) dwgsc (vlax-get-property UnZoSetg 'DrawingScale) ) ;(vlax-dump-object UnZoSetg t) (princ) ) ;-----------------------------------end getdoc--------------------------------------------- ;---------------GETAECAPPNO function---------------------------- (defun getAecAppNumber() (setq aecappno (cond ((vl-string-search "\\R17.0\\" prod) ".4.0" ) ;;2007 ((vl-string-search "\\R17.1\\" prod) ".5.0" ) ;;2008 ((vl-string-search "\\R17.2\\" prod) ".6.0" ) ;;2009 ((vl-string-search "\\R18.0\\" prod) ".7.0" ) ;;2010 ((vl-string-search "\\R18.1\\" prod) ".8.0" ) ;;2011 ((vl-string-search "\\R18.2\\" prod) ".9.0" ) ;;2012 ((vl-string-search "\\R19.0\\" prod) ".10.0" ) ;;2013 ((vl-string-search "\\R19.1\\" prod) ".10.3" ) ;;2014 ((vl-string-search "\\R20.0\\" prod) ".10.4" ) ;;2015 ((vl-string-search "\\R20.1\\" prod) ".10.5" ) ;;2016 ((vl-string-search "\\R21.0\\" prod) ".11.0" ) ;;2017 (t "") ) ) );end defun ;------------------------------end getaecappno-------------------------------------------------


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

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut
Message 4 of 5

Anonymous
Not applicable

Sorry, Noob here, how do I utilize this on launch?  I have an autolisp setup to set all my variables once a drawing is opened.  Can the visual lisp be done similarly?...can a visual lisp be launched from an autolisp file?

0 Likes
Message 5 of 5

tcorey
Mentor
Mentor

I would not use that as-is. The variables need to be localized. I can post new code tomorrow if you need.  

 

To to make this work for every drawing you open, the code would be pasted into acaddoc.lsp. 



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

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut
0 Likes