Jump to content

Entmake a block with an existing attribute?


Recommended Posts

Posted

I'm trying to create a block with an annotative attribute. It took several days to figure out but I have an annotative attribute with all the scales I need added thru objectscale. Now I need to put the block around it, essentially a rectangle. I have created that block as well, separately, it's pretty standard entmake block stuff. I don't know how I can include the attribute in the blocks creation and still add the scales. How can I merge the attribute into the block? Here's the code for the attribute:

(entmake (list
          '(0 . "ATTDEF")
          '(8 . "0")
           (cons 10 (list 0.0 0.0 0.0))
          '(40 . 0.09375)
          '(41 . 1.0)
          '(72 . 4)
          '(73 . 2)
           (cons 1 label)
          '(7 . "Annotative")
           (cons 3 label)
           (cons 2 label)
          '(70 . 2)
          '(-3
            ("AcadAnnotative"
              (1000 . "AnnotativeData")
              (1002 . "{")
                (1070 . 1)
                (1070 . 1)
              (1002 . "}")
            )
          )
        )
      )
      (setq labelAtt (entlast))
      (command "-objectscale" labelAtt "" "_a" "1/32\" = 1'-0\"" "1/16\" = 1'-0\"" "3/32\" = 1'-0\"" "1/8\" = 1'-0\""
              "3/16\" = 1'-0\"" "1/4\" = 1'-0\"" "3/8\" = 1'-0\"" "1/2\" = 1'-0\"" "3/4\" = 1'-0\"" "1\" = 1'-0\""
              "1 1/2\" = 1'-0\"" "")

 

That last bit where I add the scales is what stops me from including it in the block's creation.

Posted (edited)

Did you look at a Mtext attribute so can have a text mask turned on.

 

Putting a box around can have problems when you change the text string and make longer or shorter text.

Edited by BIGAL
Posted

I'm doing more than just a box around text, I said essentially a box to give an idea as to what I'm working with. I'm using an attribute so it maintains it's orientation so MText won't work unless there's a secret I don't know about. All I need is some code to take the attribute and merge it into the block. Lee's block merge worked but I'm not sure how to trim his code down to just merge this into that.

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