Lee Mac Posted May 29, 2009 Share Posted May 29, 2009 amazing as always thanks! No probs Quote Link to comment Share on other sites More sharing options...
doru10 Posted June 1, 2011 Share Posted June 1, 2011 Not too difficult (defun c:NdUpd (/ doc spc nd1 nd2 pl mtxt pt ndlst blk turns) (vl-load-com) (setq doc (vla-get-ActiveDocument (vlax-get-Acad-Object)) spc (if (zerop (vla-get-activespace doc)) (if (= (vla-get-mspace doc) :vlax-true) (vla-get-modelspace doc) (vla-get-paperspace doc)) (vla-get-modelspace doc))) (if (or (tblsearch "BLOCK" "NODE") (findfile "NODE.dwg")) (if (and (setq nd1 (car (entsel "\nSelect Node 1: "))) (eq "INSERT" (cdadr (entget nd1))) (eq "PNODE" (strcase (cdr (assoc 2 (entget nd1)))))) (if (and (setq nd2 (car (entsel "\nSelect Node 2: "))) (eq "INSERT" (cdadr (entget nd2))) (eq "PNODE" (strcase (cdr (assoc 2 (entget nd2)))))) (if (and (setq pl (car (entsel "\nSelect Line Object: "))) (member (cdadr (entget pl)) '("LWPOLYLINE" "POLYLINE" "LINE"))) (if (setq pt (getpoint "\nSelect Point for Block: ")) (progn (and (setq mtxt (car (entsel "\nSelect MTEXT: "))) (wcmatch (cdadr (entget mtxt)) "*TEXT")) (setq turns (getint "\nSpecify Number of Turns: ")) (setq ndlst (mapcar (function (lambda (x) (cdr (assoc 1 (entget (entnext x)))))) (list nd1 nd2))) (setq blk (vla-insertblock spc (vlax-3D-point (trans pt 1 0)) "NODE.dwg" 1. 1. 1. 0.)) (foreach att (vlax-safearray->list (vlax-variant-value (vla-getAttributes blk))) (cond ((eq "NODE1" (vla-get-TagString att)) (vla-put-TextString att (car ndlst))) ((eq "NODE2" (vla-get-TagString att)) (vla-put-TextString att (cadr ndlst))) ((eq "LENGTH" (vla-get-TagString att)) (vla-put-TextString att (rtos (vla-get-Length (vlax-ename->vla-object pl))))) ((eq "TURNS" (vla-get-TagString att)) (if turns (vla-put-TextString att (rtos turns)))) ((eq "COIL" (vla-get-TagString att)) (vla-put-TextString att (if mtxt (cdr (assoc 1 (entget mtxt))) "")))))) (princ "\n<!> No Point Selected <!>")) (princ "\n<!> Incorrect LINE Object Selection <!>")) (princ "\n<!> Incorrect Selection of NODE 2 <!>")) (princ "\n<!> Incorrect Selection of NODE 1 <!>")) (princ "\n<!> NODE Block not Found <!>")) (princ)) Very interesting LISP Lee-Mac. It can automatically change node value to the block (after the RE command), when the value PNODE edit and / or length of the polyline? Sincerely, Doru Label and Node.dwg Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 1, 2011 Share Posted June 1, 2011 Very interesting LISP Lee-Mac. It can automatically change node value to the block (after the RE command), when the value PNODE edit and / or length of the polyline? Sincerely, Doru There would probably be a way using Fields to link the values, however this is such old code I would most likely rewrite the whole thing Quote Link to comment Share on other sites More sharing options...
doru10 Posted June 1, 2011 Share Posted June 1, 2011 There would probably be a way using Fields to link the values, however this is such old code I would most likely rewrite the whole thing Thanks for the reply. I thought that I add variations and lines as your existing lisp. I'm beginning to programming and trying to discover and understand as much. Thank you sincerely. Doru Quote Link to comment Share on other sites More sharing options...
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.