Dayananda Posted February 21, 2020 Posted February 21, 2020 I need to create a lisp code to copy an item from a Block and place at same location but in difference layer. Please help to create a code to use NCOPY command with a lisp code. Quote
BIGAL Posted February 22, 2020 Posted February 22, 2020 Get a pencil and paper and write down every command as you do it manually. Then rewrite as lisp. Quote
Dayananda Posted February 22, 2020 Author Posted February 22, 2020 38 minutes ago, BIGAL said: Get a pencil and paper and write down every command as you do it manually. Then rewrite as lisp. That is the way I am doing. But difficulty is select the relevant entity of the block. Entsel or SSget command is selecting the whole block not the entity. Pl help. Quote
Dayananda Posted February 22, 2020 Author Posted February 22, 2020 (defun c:test(/ p1) (setq p1(cadr(entsel))) (command "NCOPY"p1"""D""") (setq ent (entlast)) (command "change" ent "" "P" "LA" "my" "") ) Finally I do it myself. But when I select attribute it does not absorb the displayed value . it goes to default Quote
dlanorh Posted February 22, 2020 Posted February 22, 2020 (edited) 14 hours ago, Dayananda said: (defun c:test(/ p1) (setq p1(cadr(entsel))) (command "NCOPY"p1"""D""") (setq ent (entlast)) (command "change" ent "" "P" "LA" "my" "") ) Finally I do it myself. But when I select attribute it does not absorb the displayed value . it goes to default Why are you trying to NCOPY an "ATTRIB" ? As it isn't in a block it will always take on the "TAG" value. Wouldn't it be better to entmake a bit of text instead, or are the two linked? Edited February 22, 2020 by dlanorh Quote
BIGAL Posted February 23, 2020 Posted February 23, 2020 Using nentsel will get what you want (entget (car (nentsel "Pick attribute"))) just look at what is returned. 1 Quote
Recommended Posts
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.