Jump to content

Recommended Posts

Posted

I'm using this code below (from Lee) to add an attribute to a block via lisp.

"Box_type" is the attribute tag and box_type_10 is the attribute value. How do I manage the color of this attribute ? I want it to appear green.

 

All help is appreciated.

 

(vlax-invoke
   blk
   'AddAttribute
   thgt2 ;text height
   acAttributeModePreset
   "Box_type"
   (list ( + (car Ma ) (/ thgt2 2)); x-axis            ;(list (/ (+ (car Mi) (car Ma)) 2.)
         (- (cadr Ma) thgt2 0.4); y-axis
         0.)
   "Box_type"
   box_type_10 ; tag value
     )                    

Posted

As you're using vla-*... Simply set the Attribute Object's Color Property to AcGreen, example:

 

(vla-put-color oAttrib acGreen)

 

Otherwise, if using DXF:

'(62 . 3)

 

HTH

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...