geoidwalker Posted November 27, 2015 Posted November 27, 2015 Two simple problems - which hopefully have two simple answers: I am writing a script to change the ambient drawing settings (see screenshot). Everything works except I can't close the text window after running the units command, and the ambient angular units don't get set (highlighted red in the screenshot). Is there an ade command that'll do this? cheers, ;Set projection to NAD83 UTM10 by default (ade_projsetwscode "UTM83-10") ;System Variables to be set ;Set Units (command "-aecdwgunits" 6 2 3 "No" "No");works (command) (command "-units" 2 3 2 8 270 "Y");works - but doesn't set ambient angular units (command) ;Shut off text window (command "graphscr"); doesn't work (command) Quote
BIGAL Posted November 27, 2015 Posted November 27, 2015 Behind say Units is a series of variables as an example below there should be the same for aecdwgsetup just need to find, 2 ways use express, tools, System variable editor. Or do setvar ? * change 1 at a time. (SETVAR "LUNITS" 2) (SETVAR "ANGBASE" 0.0) (SETVAR "ANGDIR" 0) (SETVAR "LUPREC" 0) (SETVAR "AUNITS" 0) (SETVAR "AUPREC" 0) Quote
Hippe013 Posted November 30, 2015 Posted November 30, 2015 You need to get the Ambient Settings Object through the Civil Application Interface. This may get you going. (setq prod (vlax-product-key)) (setq prodStr (strcat "AeccXUiLand.AeccApplication" (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 (t "") ) ) ) (setq aeccApp (vlax-invoke-method (vlax-get-acad-object) 'GetInterfaceobject prodstr));Get the Civil Application (setq aeccDoc (vlax-get-property aeccApp 'ActiveDocument)) ;Get the Active Civil Document from the Civil Application (setq sets (vlax-get-property aeccDoc 'Settings)) ;Get the Root Settings from the Document (setq dwgset (vlax-get-property sets 'DrawingSettings)) ;Get the Drawing Settings from the Root Settings (setq ambset (vlax-get-property dwgset 'AmbientSettings)) ;Get the Ambient Settings from the dwg settings As far as the Text Screen goes try: (graphscr) ;or (textscr) Quote
geoidwalker Posted December 1, 2015 Author Posted December 1, 2015 Thanks Hippe013 - this looks promising. I'll give it a go after things slow down a bit for the holidays... Quote
geoidwalker Posted March 21, 2016 Author Posted March 21, 2016 Ok so the script is working now and does what I want it to do...except the text window will not close. (graphscr) returns nil as expected - so I have: (graphscr) (princ) And I've tried various iterations: (command "graphscr") or (command "_.graphscr") And they all return nil so I know its running the command...yet the text window just will not close.... If I run any of those after the lisp has completed it close the window as expected. Or if I hit F2 it closes - just not from the lisp....grrr.... Any thoughts? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.