Jump to content

Match layer properties


broncos15

Recommended Posts

I have a quick question about the matchprop command. Is there an easy to access the matchprop settings variable? I have looked everywhere and I can't seem to find what it is. As a result, I have been using this matchlayer lisp because the laymch command works backwards. My issue with the code is that I can't get it to function just like the matchprop command. Main issues: I don't know how to get entsel to go immediately to choosing the destination object after the source object is chosen, and I don't know how to get the lisp to preview what the destination object will look like like how the matchprop command does. Is there an easy fix that I am missing with this code, or even easier, a variable for matchprop I can mess with to make this lisp much simpler? Thank you in advance for the help!

(defun c:matchlayer (/ ent entlay stuff)
(setq ENT (entget (car (entsel "\nSelect entity on TARGET layer:  "))))
(setq ENTLAY (cdr (assoc 8 ENT)))
(setq TEXT '"Entity layer is ")
(setq TITLE (strcat TEXT ENTLAY))
(prompt TITLE)
(setq STUFF (SSGET))
(command "CHANGE" STUFF "" "Properties" "LAYER" ENTLAY "C" "bylayer" "LT" "bylayer" "S" "1.0" "")
(PRINC)
)

Link to comment
Share on other sites

my version

 

(defun c:matchlayer (/ ent entlay stuff)
(setq ENT (entget (car (entsel "\nSelect entity on TARGET layer:  "))))
(setq ENTLAY (cdr (assoc 8 ENT)))
(alert (strcat "Entity layer is " entlay))
(setq STUFF (SSGET))
(command "_chprop" STUFF "" "LAYER" ENTLAY "C" "bylayer" "LT" "bylayer" "S" "1.0" "")
(PRINC)
)

Edited by BIGAL
Link to comment
Share on other sites

my version

 

(defun c:matchlayer (/ ent entlay stuff)
(setq ENT (entget (car (entsel "\nSelect entity on TARGET layer:  "))))
(setq ENTLAY (cdr (assoc 8 ENT)))
(alert (strcat "Entity layer is " entlay))
(setq STUFF (SSGET))
(command "_chprop" STUFF "" "LAYER" ENTLAY "C" "bylayer" "LT" "bylayer" "S" "1.0" "")
(PRINC)
)

BIGAL, thank you for the help. I think the chprop command is better than my change command. I was curious, how does your code go from selecting the target layer to the destination layer without making the user hit enter? My original code seems almost identical, so I am curious how you did that.
Link to comment
Share on other sites

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...