Jump to content

Make Layer Color 11


neekcotrack

Recommended Posts

I have a lisp and I have not been at this for a while so I can't remember how to make the layer E-Wire to have the color 11. instead of white. Thanks appriate any help given.

 

(vl-load-com)
(defun C:tics (/
ActiveDocObj
Ent
EntName
EntObj
InsParam
InsPoint
Temp
TextAngle
TextHeight
TextString
TextWidth
TextStyle
TextLayer
)
(setq TextHeight 8.0
TextString ""
TextWidth 0.31
TextStyle "Tics"
TextLayer "E-Wire"
)
(if (not (tblsearch "STYLE" TextStyle))
(entmake (list (cons 0 "STYLE")
(cons 100 "AcDbSymbolTableRecord")
(cons 100 "AcDbTextStyleTableRecord")
(cons 2 TextLayer)
(cons 70 0)
(cons 40 TextHeight)
(cons 41 1.0)
(cons 50 0.0)
(cons 71 0)
(cons 42 TextHeight)
(cons 3 "romans.shx")
(cons 4 "")
)
)
)
(repeat (progn (initget 7) (getint "\nNumber of tics: "))
(setq TextString (strcat TextString "/"))
)
(setq ActiveDocObj (vla-get-activedocument (vlax-get-acad-object)))
(vla-EndUndoMark ActiveDocObj)
(while (and (setq Ent (entsel)))
(setq EntName (car Ent))
(if
(and (wcmatch (vla-get-ObjectName
(setq EntObj (vlax-ename->vla-object EntName))
)
"AcDbLine,AcDbPolyline,AcDbArc,AcDbCircle"
)
(setq InsPoint (vlax-curve-getClosestPointTo EntObj (cadr Ent)))
(setq InsParam (vlax-curve-getParamAtPoint EntObj InsPoint))
)
(progn (setq TextAngle
((lambda (d)
(if (zerop (cadr d))
(/ pi 2)
(atan (apply '/ d))
)
)
(cdr (reverse
(vlax-curve-getFirstDeriv EntObj InsParam)
)
)
)
)
(vla-startundomark ActiveDocObj)
(entmake (list (cons 0 "TEXT")
(cons 7 TextStyle)
(cons 8 TextLayer)
(cons 1 TextString)
(cons 40 TextHeight)
(cons 10 InsPoint)
(cons 11 InsPoint)
(cons 41 TextWidth)
(cons 50 TextAngle)
(cons 72 1)
(cons 73 2)
)
)
(vla-endundomark ActiveDocObj)
)
)
)
(princ)
)

Link to comment
Share on other sites

Something like this?


(vl-load-com)
(defun C:tics (/
ActiveDocObj
Ent
EntName
EntObj
InsParam
InsPoint
Temp
TextAngle
TextHeight
TextString
TextWidth
TextStyle
TextLayer
)
(setq TextHeight 8.0
TextString ""
TextWidth 0.31
TextStyle "Tics"
TextLayer "E-Wire"
)
(if (not (tblsearch "STYLE" TextStyle))
(entmake (list (cons 0 "STYLE")
(cons 100 "AcDbSymbolTableRecord")
(cons 100 "AcDbTextStyleTableRecord")
(cons 2 [color=red]TextStyle[/color])
(cons 70 0)
(cons 40 TextHeight)
(cons 41 1.0)
(cons 50 0.0)
(cons 71 0)
(cons 42 TextHeight)
(cons 3 "romans.shx")
(cons 4 "")
)
)
)
(repeat (progn (initget 7) (getint "\nNumber of tics: "))
(setq TextString (strcat TextString "/"))
)
(setq ActiveDocObj (vla-get-activedocument (vlax-get-acad-object)))
(vla-EndUndoMark ActiveDocObj)
(while (and (setq Ent (entsel)))
(setq EntName (car Ent))
(if
(and (wcmatch (vla-get-ObjectName
(setq EntObj (vlax-ename->vla-object EntName))
)
"AcDbLine,AcDbPolyline,AcDbArc,AcDbCircle"
)
(setq InsPoint (vlax-curve-getClosestPointTo EntObj (cadr Ent)))
(setq InsParam (vlax-curve-getParamAtPoint EntObj InsPoint))
)
(progn (setq TextAngle
((lambda (d)
(if (zerop (cadr d))
(/ pi 2)
(atan (apply '/ d))
)
)
(cdr (reverse
(vlax-curve-getFirstDeriv EntObj InsParam)
)
)
)
)
(vla-startundomark ActiveDocObj)
;;;(entmake (list (cons 0 "TEXT")
;;;(cons 7 TextStyle)
;;;(cons 8 TextLayer)
;;;(cons 1 TextString)
;;;(cons 40 TextHeight)
;;;(cons 10 InsPoint)
;;;(cons 11 InsPoint)
;;;(cons 41 TextWidth)
;;;(cons 50 TextAngle)
;;;(cons 72 1)
;;;(cons 73 2)
;;
;;
;;============================
(entmake
       (list
       (cons 0  "TEXT")
       (cons 100  "AcDbEntity")
       (cons 100  "AcDbText")      
       (cons 1 TextString);string
       (cons 7 TextStyle);style
       (cons 8 TextLayer);layer
[color=red](cons 62 11);color[/color]
       (cons 10 InsPoint);insertion point
       (cons 11 InsPoint);alignment point
       (cons 40 TextHeight);text height
(cons 41 TextWidth);text width
(cons 50 TextAngle);1.5708 - vertical, 0.0 - horizontal
(cons 51 0.0);oblique angle 
(cons 71  0);alignment flag
(cons 72  1);alignment flag
(cons 73  2);alignment flag
)
)
 
(vla-endundomark ActiveDocObj)
)
)
)
(princ)
)

 

~'J'~

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...