Lisp Help to Change all Dimensions to Layer Dimension, Color Bylayer, Lineweight Bylayer and Linetype to Bylayer

Lisp Help to Change all Dimensions to Layer Dimension, Color Bylayer, Lineweight Bylayer and Linetype to Bylayer

Anonymous
Not applicable
2,285 Views
5 Replies
Message 1 of 6

Lisp Help to Change all Dimensions to Layer Dimension, Color Bylayer, Lineweight Bylayer and Linetype to Bylayer

Anonymous
Not applicable

Hey Fam, i need help with a lisp im trying to put together. 

I was able to get the layers portion to work but i cannot seem to get color, lineweight and linetype to all change to bylayer. can someone look at this code for me please. i was able to change it all with line commands but via lisp it wont work for me 😞

 

(defun c:DL (/ SelectDim)
(setq SelectDim (ssget "X" '((0 . "DIMENSION"))))
(command "._Chprop" SelectDim "" "Layer" "DIMENSION" "Color" "BYLAYER" "LWeight" BYLAYER" "LType" BYLAYER" "")
(princ)
); end of defun

 

Thanks Fam!!

0 Likes
Accepted solutions (1)
2,286 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable

sorry Fam, i forgot to add the Dim DWG

The DWG show the correct format for this Dim and how they should be throughout my drawing.

 

0 Likes
Message 3 of 6

doaiena
Collaborator
Collaborator
Accepted solution

You just had the quotation marks wrong.

(defun c:DL (/ SelectDim)
(setq SelectDim (ssget "X" '((0 . "DIMENSION"))))
(command "._Chprop" SelectDim "" "Layer" "DIMENSION" "Color" "BYLAYER" "LWeight" "BYLAYER" "LType" "BYLAYER" "")
(princ)
); end of defun
Message 4 of 6

Anonymous
Not applicable

That works! thank you so much!

0 Likes
Message 5 of 6

Anonymous
Not applicable

omg i just realized what you said lol....im a dork for missing the quotation marks...thanks again!

0 Likes
Message 6 of 6

kevin
Contributor
Contributor

;Dimensions are influenced by many variables.  Colors start with "DIMCLR" plus one more letter D, T, E, etc.

;Here's my Lisp file/script file below for setting my dims.  The default for bylayer is a period.

 ;* By Kevin McDougall, 1994
;* C:DIMEN command, Sets the following dimension variables.
(command "DIMASZ" "0.14"
"DIMTIH" 0
"DIMTOH" 0
"DIMTA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SAVEFIDELITY" 0
"QPMODE" 0
"SNAPMODE" 0
"SELECTIONPREVIEW" 0
"PROPERTYPREVIEW" 0
"ANNOALLVISIBLE" 0
"annoautoscale" 0
"textstyle" "L120"
);command
(prompt "\nStandard dimensioning style set.")
(princ)



0 Likes