您需要通过Civil Application界面获取环境设置对象。这可能会让你走。
- (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
就文本屏幕而言,请尝试:
|