Search the Community
Showing results for tags 'layer names'.
-
LL - Label Line changing code to Label point with its own layer name
bobbykimchi posted a topic in AutoLISP, Visual LISP & DCL
Hi, I am trying to find a way to label points with its own layer name like the attached lisp commando. It does it with line/polylines. Also I am trying to find a way to do this with multiple points, therefore the rotation of the imported mtext does not need to be aligned. Could anyone help me find a way to edit the code downstairs or help me with a new code? (defun alg-ang (obj pnt) (angle '(0. 0. 0.) (vlax-curve-getfirstderiv obj (vlax-curve-getparamatpoint obj pnt ) ) ) ) (defun C:LL (/ *error* acsp adoc ang fld midp mtx rot sset txtpt) (defun *error* (msg) (if (vl-position msg '("console break" "Function cancelled" "quit / exit abort" ) ) (princ "Error!") (princ msg) ) (vla-endundomark (vla-get-activedocument (vlax-get-acad-object) ) ) (princ) ) (or adoc (setq adoc (vla-get-activedocument (vlax-get-acad-object) ) ) ) (if (and (= (getvar "tilemode") 0) (= (getvar "cvport") 1) ) (setq acsp (vla-get-paperspace adoc)) (setq acsp (vla-get-modelspace adoc)) ) (vla-startundomark adoc ) (if (setq sset (ssget "_:L" (list (cons 0 "*LINE,ARC,CIRCLE,ELLIPSE")))) (foreach obj (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex sset)))) (if (not (eq "AcDbArc" (vla-get-objectname obj))) (setq midp (vlax-curve-getclosestpointto obj (vlax-curve-getpointatparam obj ( / (- (vlax-curve-getEndParam obj) (vlax-curve-getStartParam obj)) 2)) ) ) (setq midp (vlax-curve-getclosestpointto obj (vlax-curve-getpointatdist obj ( / (vla-get-arclength obj) 2))) ) ) (setq ang (alg-ang obj midp)) (if (> pi ang (/ pi 2)) (setq ang (+ ang pi)) ) (if (> (* pi 1.5) ang pi) (setq ang (+ ang pi)) ) (setq rot (+ ang (/ pi 2))) (setq txtpt (polar midp rot (if (zerop (getvar "dimtxt")) 0.1 (/ (getvar "dimtxt") 2))) ) (setq fld (strcat "%<\\AcObjProp Object(%<\\_ObjId " (itoa (vla-get-objectid obj)) ">%).Layer>%") ) (setq mtx (vlax-invoke acsp 'AddMText midp 0.0 fld) ) (vlax-put mtx 'AttachmentPoint 8 ) (vlax-put mtx 'InsertionPoint txtpt ) (vlax-put mtx 'Rotation ang ) ) ) (princ) ) (princ "\n\t\t\tType LL to label curves with layer name\t") (prin1) (vl-load-com) ll-Label A line with its own layer name.txt -
Dear folks, We all know that Revit has tagging capabilities and I know that AutoCAD can also do that with Lisp. Lets assume we have 5 different solid hatch each in different layers like: Layer Name - L1 Layer Name - L2 Layer Name - L3 Layer Name - L4 Layer Name - L5 I want to place a block named LNAME with an attribute and place them onto hatches and get the Object->Layer proporty in it. I attached the sample file. Thanks in advanced. MA LISP-TAGGING.dwg
- 11 replies
-
- lisp
- layer names
-
(and 1 more)
Tagged with:
-
Hi, i export from arcGIS server shape files, then i import them with object data using drawing layer and "use data field for layer name". I get layers created by "codes". After that i use LAYTRANS to translate layers to my own created layers. So my question - is there any way to automatically insert block by mouse click on point (block names and layer names are the same)? maybe a some king of lisp could do that? p.s. sorry for my English language...
-
When I open the layers dialog box my layer names are scrambled up and not in order like they once were. I have to hit the "Name" tab to get them back. I have tried re-setting it back to how it was but can't figure out how. When I opened an old file of the same drawing and the layers are in their original positions. How do I get them to stick? Thanks
- 5 replies
-
- layer settings
- layer names
-
(and 1 more)
Tagged with: