I need a lisp routine to change the abbreviations in drawing settings. Anyone have one, or any guidance on how I can create one. I've never written a lisp before, I tried now but couldn't even get mine to run the EDITDRAWINGSETTINGS command.
Solved! Go to Solution.
I need a lisp routine to change the abbreviations in drawing settings. Anyone have one, or any guidance on how I can create one. I've never written a lisp before, I tried now but couldn't even get mine to run the EDITDRAWINGSETTINGS command.
Solved! Go to Solution.
Solved by hippe013. Go to Solution.
The following should help you get going. It demonstrates how to drill down to the abbreviation settings and how to set the values. I'll leave the rest up to you.
(defun c:test () (setq ad (_GetAeccDocument)) ;Get the Aecc Document (setq s (vlax-get-property ad 'Settings)) ;Get the aecc settings from the Aecc Document (setq ds (vlax-get-property s 'DrawingSettings)) ;Get the Drawing Settings from the aecc settings (setq as (vlax-get-property ds 'AbbreviationSettings)) ;Get the abbreviation settings from the drawing settings (setq alignAbbrev (vlax-get-property as 'AlignmentAbbreviations)) ;Get the Alignment abbreviations from the abbreviation settings (setq alignBeg (vlax-get-property alignAbbrev 'AlignmentBeginning)) ;Get the alignment beginning abbreviation from the alignment abbreviations (princ (strcat "\nCurrent AlignmentBeginning Abbreviation: " alignBeg)) ;Print the current value of the alignment beginning abbreviation (vlax-put-property alignAbbrev 'AlignmentBeginning "BEG") ;Set the value of the Alignment Beginning abbreviation (princ (strcat "\nNew AlignmentBeginning Abbreviation: " (vlax-get-property alignAbbrev 'AlignmentBeginning))) ;Print the new value of the alignment beginning abbreviation (princ) ;exit clean ) (defun _GetAeccDocument () (setq C3D (strcat "HKEY_LOCAL_MACHINE\\" (if vlax-user-product-key (vlax-user-product-key) (vlax-product-key) ) ) C3D (vl-registry-read C3D "Release") C3D (substr C3D 1 (vl-string-search "." C3D (+ (vl-string-search "." C3D) 1))) C3D (vla-getinterfaceobject (vlax-get-acad-object) (strcat "AeccXUiLand.AeccApplication." C3D))) (vlax-get-property C3D 'ActiveDocument) )
The following should help you get going. It demonstrates how to drill down to the abbreviation settings and how to set the values. I'll leave the rest up to you.
(defun c:test () (setq ad (_GetAeccDocument)) ;Get the Aecc Document (setq s (vlax-get-property ad 'Settings)) ;Get the aecc settings from the Aecc Document (setq ds (vlax-get-property s 'DrawingSettings)) ;Get the Drawing Settings from the aecc settings (setq as (vlax-get-property ds 'AbbreviationSettings)) ;Get the abbreviation settings from the drawing settings (setq alignAbbrev (vlax-get-property as 'AlignmentAbbreviations)) ;Get the Alignment abbreviations from the abbreviation settings (setq alignBeg (vlax-get-property alignAbbrev 'AlignmentBeginning)) ;Get the alignment beginning abbreviation from the alignment abbreviations (princ (strcat "\nCurrent AlignmentBeginning Abbreviation: " alignBeg)) ;Print the current value of the alignment beginning abbreviation (vlax-put-property alignAbbrev 'AlignmentBeginning "BEG") ;Set the value of the Alignment Beginning abbreviation (princ (strcat "\nNew AlignmentBeginning Abbreviation: " (vlax-get-property alignAbbrev 'AlignmentBeginning))) ;Print the new value of the alignment beginning abbreviation (princ) ;exit clean ) (defun _GetAeccDocument () (setq C3D (strcat "HKEY_LOCAL_MACHINE\\" (if vlax-user-product-key (vlax-user-product-key) (vlax-product-key) ) ) C3D (vl-registry-read C3D "Release") C3D (substr C3D 1 (vl-string-search "." C3D (+ (vl-string-search "." C3D) 1))) C3D (vla-getinterfaceobject (vlax-get-acad-object) (strcat "AeccXUiLand.AeccApplication." C3D))) (vlax-get-property C3D 'ActiveDocument) )
Thanks a million for this!
It took a while to figure out, but I managed to get it to change all the abbreviations I needed to.
Thanks a million for this!
It took a while to figure out, but I managed to get it to change all the abbreviations I needed to.
Can't find what you're looking for? Ask the community or share your knowledge.