numberOCD Posted October 26, 2011 Posted October 26, 2011 Hey there, I'm have a long span of conduits in this tunnel and need to label each of the conduits its 3-4 digit assignment in each viewport of each page. I made a center line to each of these conduits in the layer named that 3-4 digit code (ex, Centerline of ET23 is in layer ET23). Does anybody know a way to make a leader that will just tell me the layer of the object (centerline) I attach it to? Or does anybody simple know a way to label the layer of an object? Thanks for the help! Quote
alanjt Posted October 26, 2011 Posted October 26, 2011 (defun c:Test (/ pt ss ent) (vl-load-com) (cond ((not (setq pt (getpoint "\nSpecify point on object: "))) nil) ((not (setq ss (ssget pt))) (alert "Point must be on object!")) (T (setq ent (entlast)) (vl-cmdf "_.mleader" "_non" pt PAUSE) (while (eq (logand 1 (getvar 'CMDACTIVE)) 1) (vl-cmdf "")) (if (not (equal ent (setq ent (entlast)))) (progn (vla-put-textstring (vlax-ename->vla-object ent) ;;(cdr (assoc 8 (entget (ssname ss 0)))) (strcat "%<\\AcObjProp Object(%<\\_ObjId " (if (vl-string-search "64" (getenv "PROCESSOR_ARCHITECTURE")) (vlax-invoke-method (vla-get-utility (cond (*AcadDoc*) ((setq *AcadDoc* (vla-get-activedocument (vlax-get-acad-object)))) ) ) 'GetObjectIdString (vlax-ename->vla-object (ssname ss 0)) :vlax-false ) (itoa (vla-get-objectid (vlax-ename->vla-object (ssname ss 0)))) ) ">%).Layer>%" ) ) (vla-regen *AcadDoc* acActiveViewport) ) ) ) ) (princ) ) Quote
numberOCD Posted October 26, 2011 Author Posted October 26, 2011 How do I use this code? Is it a LISP? And if so, What is the activation command? Thanks Quote
alanjt Posted October 26, 2011 Posted October 26, 2011 I assumed too much - sorry about that. It's a LISP routine. The syntax is just 'TEST'. Read this for loading: http://www.cadtutor.net/forum/showthread.php?1390-How-to-use-the-LISP-routines-in-this-archive Quote
numberOCD Posted October 26, 2011 Author Posted October 26, 2011 Thanks, works great. I know a bit about LISP Routines, but still not familiar with coding; so I couldn't quite identify the syntax. Thanks again for saving me hours! 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.