BShick5088 Posted September 29, 2014 Posted September 29, 2014 Good morning, I have a piece of LISP that allows me to pick a block then pass the data into a new block's attributes, the problem is that when I run it in a script file it does not seem to pick the blocks using the coordinates given even though it does if it is manually typed in to test the function.... Is there someone that can show me what I need to change in the attached LISP to automatically fix the block data and not require the user to pick anything, just use the block names...? Thank you all very mush for helping. Copy Attributes to new blocks.lsp Quote
hanhphuc Posted September 29, 2014 Posted September 29, 2014 (edited) hi , welcome to forum it seems duplicate thread? http://www.cadtutor.net/forum/showthread.php?45915-Lisp-for-attribute-extract-from-block/page3 Edited September 29, 2014 by hanhphuc Quote
BShick5088 Posted September 29, 2014 Author Posted September 29, 2014 (edited) Thanks, but I don't understand LISP well enough to figure out what is different... The example routine starts with: (defun c:COPATT ( / e x) (setq e (car (entsel "\nSelect your block : ")) x (entget e) ) (if (= "MFTB" (cdr (assoc 2 x)) );Original Block Name SPTLB or MFTB Your example starts with: (defun c:test ( / myentsel des src val ) (setq myentsel (lambda ( msg / ent enx ) (while (progn (setvar 'errno 0) (setq ent (car (entsel msg))) Please remember, I barely have any LISP experience and don't understand much of what is going on here, that is why I added notes at each step of the attached LISP. Does the picking ability have something to do with the ( / myentsel des src val ) part at the beginning? Thanks for looking at this for me... Edited September 29, 2014 by BShick5088 Clearity Quote
BIGAL Posted September 30, 2014 Posted September 30, 2014 You can not entsel via a pt (entsel pt) manually it will work maybe not in a script. Anyway if you use ssget you can do a pt (ssget "C" '(-1 -1) '(1 1)) for the point 0,0 then just get the 1st entry (ssname ss 0) a little bit of recoding Quote
SLW210 Posted September 30, 2014 Posted September 30, 2014 BShick5088, Please read the Code Posting Guidelines and edit your posts to include the Code in Code Tags. 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.