Jump to content

Recommended Posts

Posted

Hi i am using this code to move all dimensions in Dim layer. But i have some dimension in ARROWDIM layer and move then to dim layer . Can any one fix the code not change the ARROWDIM  dimensions?

 

 

    (defun c:DLDL (/ sel1 CLAYER )
;Switch from Layout Tab To Model Tab before stating LISP
    (command "_.Tilemode" 1) ; To model space
   (if  (setq sel1 (ssget "X" '((0 . "DIMENSION")))) ; SELECT ALL DIMENSION
(progn
    (setq OLDLAYER (getvar "CLAYER")) ;GET CURRENT LAYER
    (COMMAND "_layer" "_m" "DIM" "_c" "7" "" "_lw" "0.30" "" "") ;CREATE NEW LAYER
    (setvar "CLAYER" OLDLAYER) ; SET ACTIVE LAYER TO PREVIOUS
    (command "CHPROP" sel1 "" ; CHANGE DIMENSION LAYER TO NEW LAYER
    "LAYER" "DIM"
    "")
   (command "_.Tilemode" 0) ;And back to last current layout
)
(alert "No Dims")
)
;(alert "Dims done")
    );END PROGRAM 

 

Thanks

Posted

Only change this string:

 

(setq sel1 (ssget "X" '((0 . "DIMENSION") (-4 . "<NOT") (8 . "ARROWDIM") (-4 . "NOT>"))))

 

  • Like 1
  • Agree 1
Posted

A nonlisp approach would be to Rename the Dim Layer, if needed, I am not sure about that, then you could just MERGE any layers you wanted into that one.

LAYMERGE is the command.  LAYISO would be another way to go at it.  Once you have selected a representative dimension from each ot the layers, to LAYISO those layers, you could select all and in one go change their layers in Quick Properties,  LAYUNISO, DONE. 

 

If these are layers used by regular drawing suppliers or contacts you could also set up a LAYTRANS mapping to do that.

 

Sorry I don't write code.  ;)

Posted

Thanks confutatis

 

I want to ask somethind else similar to previous  question

 

I have this code to draw two arrow lines. It is a simle code ,it is an align dimension without dimension text. The problem is when i do a simple align dimension i use 3 point click. First point, secont point and the final position point. with this code after the secont point insert the tow arrow line. Is any way to use a third point for the final position of the tow arrow line?

 

(defun C:DNTE (/ pt1 pt2); = Dimension No Text or Extension
 (command "_layer" "_m" "ARROWLINE" "_c" "1" "" "_lw" "0.30" "" "") ;CREATE NEW LAYER
 (setvar "CLAYER" "ARROWLINE")
 (command "-DIMSTYLE" "R" "_DIM")
  (setq

    pt1 (getpoint "\nFirst point: ")

    pt2 (getpoint "\nSecond point: ")

  ); setq

  (command "_dimaligned" "_none" pt1 "_none" pt2 "_text" " " "_none" pt3)

); defun

 

Posted
36 minutes ago, prodromosm said:

I have this code to draw two arrow lines. It is a simle code ,it is an align dimension without dimension text. The problem is when i do a simple align dimension i use 3 point click. First point, secont point and the final position point. with this code after the secont point insert the tow arrow line. Is any way to use a third point for the final position of the tow arrow line?

Try:

(defun C:DNTE (/ pt1 pt2 text); = Dimension No Text or Extension
 (command "_layer" "_m" "ARROWLINE" "_c" "1" "" "_lw" "0.30" "" "") ;CREATE NEW LAYER
 (setvar "CLAYER" "ARROWLINE")
 (command "-DIMSTYLE" "R" "_DIM")
  (setq
    pt1 (getpoint "\nFirst point: ")
    pt2 (getpoint "\nSecond point: ")
    text (getstring "\nDim Text: ")
  ); setq
  (command "_dimaligned" "_none" pt1 "_none" pt2 "_text" text pause)
); defun

 

  • Agree 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...