Set dimscale to selected dim

Royker

Usenet Archive
Joined
Feb 2, 2004
Messages
4
Reaction score
0
I've been toying around with a macro that will set the dimscale to the scale of a selected dimension. What I can't figure out is how to extract the dimension scale property of the selected dimension. I have done somewhat the opposite by having a Diesel function extract the value of the dimscale variable and applying as the scale when inserting a block.
 
Here's a function to return the DIMSCALE of a selected dimension:

To use it, supply it with an entity name, e.g. (getdimscale (car (entsel)))

(defun getdimscale (en / el xd dimscal)
(if en
(progn
(setq el (entget en))
; check to see if it's a dimension object.
(if (= (cdr (assoc 0 el)) "DIMENSION")
(progn
; check to see if an override for DIMSCALE (assoc 40) is set. (setq en (entget en '("ACAD"))) (setq xd (cdr (assoc -3 en))) (if (assoc 40 xd) ; yes, override exists.... (setq dimscal (cdr (assoc 40 xd))) ) ; no override, get DIMSCALE from DIMSTYLE table... (if (not dimscal) (setq dimscal (cdr (assoc 40 (tblsearch "DIMSTYLE" (cdr (assoc 3 el))) ) ) ) ) ) ) ) ) dimscal )
 
(setq obj (vlax-ename->vla-object (car (entsel "\nselect a dimension:"))))

(vla-get-scalefactor obj)
 
Use -dimstyle

and select dimension

Then repeat and select Apply

Jan

Royker said:
I've been toying around with a macro that will set the dimscale to the
scale of a selected dimension. What I can't figure out is how to extract the dimension scale property of the selected dimension. I have done somewhat the opposite by having a Diesel function extract the value of the dimscale variable and applying as the scale when inserting a block.
 

Member Recommended

Back
Top