Change dim style + current layer

Change dim style + current layer

Temssi.d
Enthusiast Enthusiast
754 Views
3 Replies
Message 1 of 4

Change dim style + current layer

Temssi.d
Enthusiast
Enthusiast

Hi,  

I need a lisp script that changes the current dim style and layer,

after selecting a specific object.

 

thanks

;Set to current dimstyle by picking an object on desired dimstyle.
(defun C:SetC ()
   (prompt "\Select Desired Dimstyle...")
   (command "-DIMSTYLE" "_R" "")  
   
;change the layer to the last object selected using "LAYMCUR"
 
   (princ)
)

 

0 Likes
Accepted solutions (1)
755 Views
3 Replies
Replies (3)
Message 2 of 4

ВeekeeCZ
Consultant
Consultant
Accepted solution

LAYMCUR does not accept "last object selected". Besides - we only have "previous" type of selection available but it holds objects (= selection set) not a single object (= entity). 

 

(defun C:SetC ( / e)
  (setq e (car (entsel "\nSelect dimension: ")))
  (command "-DIMSTYLE" "_R" "" e)
  (command "LAYMCUR" e) 
  (princ)
  )

 

Message 3 of 4

Kent1Cooper
Consultant
Consultant

ADDSELECTED will do both those things for you without any code, and call up a Dimensioning command [presumably you don't need to change those settings unless/until you want to make more Dimensions].  You can also use the MM command in MakeMore.lsp, >here<, which in addition offers you options to make a New Dimension of the same type anywhere you want, or apply the DIMCONTINUE or DIMBASELINE command springing from the selected Dimension.

Kent Cooper, AIA
Message 4 of 4

Temssi.d
Enthusiast
Enthusiast

WOW

0 Likes