Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
How do add a block as an attribute for another block?
Im trying to add "block-name" to this block.
(entmake
(list
'(0 . "BLOCK")
(cons 2 blkname) ; block name
'(70 . 2)
(cons 8 clayerb) ; layer
(cons 10 pnt) ; insertion point
'(4 . "SRVPNOC") ; comment
)
) ; end of block
; 1=default value ; 2=Tag ; 3=Prompt
(entmake
(list
'(0 . "ATTDEF")
(cons 8 clayer1) ; layer
(cons 10 pnt) ; insertion point
'(70 . 0) ; attribute flags (non-constant, invisible, doesn't lock)
(cons 3 "") ; 3=Prompt (empty string)
(cons 2 block-name) ; 2=Tag (attribute tag)
(cons 1 "") ; 1=default value (attribute value)
(cons 40 htx) ; height
(cons 41 wdy) ; width
(cons 11 pnt) ; match insertion point
'(72 . 0) ; 0=10 as insertion point
)
)
(entmake
(list
'(0 . "ATTDEF")
(cons 8 clayer2) ; layer
(cons 10 elevdir) ; insertion point
'(70 . 0) ; attribute flags
'(3 . "Elevation Value") ; 3=Prompt
'(2 . "ELEV2") ; 2=Tag
(cons 1 (rtos ELEV 2 2)) ; 1=default value
(cons 40 htx) ; height
(cons 41 wdy) ; width
(cons 7 styname) ; text style
(cons 11 elevdir) ; match insertion point
'(72 . 0) ; 0=10 as insertion point
)
)
(entmake '((0 . "ENDBLK")) ) ; end of block with attdef
; insert the block
(entmake
(list
'(0 . "INSERT")
(cons 2 blkname) ; block name
(cons 8 clayeri) ; layer
'(66 . 1) ; has attributes
(cons 10 pnt) ; insertion point
(cons 41 sclx) ; x scale
(cons 42 sclx) ; y scale
(cons 43 sclx) ; z scale
)
) ; begin insert Block
; attrib #1
(entmake
(list
'(0 . "ATTDEF")
(cons 8 clayer1) ; layer
(cons 10 pnt) ; insertion point
'(70 . 0) ; attribute flags (non-constant, invisible, doesn't lock)
(cons 3 "") ; 3=Prompt (empty string)
(cons 2 block-name) ; 2=Tag (attribute tag)
(cons 1 "") ; 1=default value (attribute value)
(cons 40 htx) ; height
(cons 41 wdy) ; width
(cons 11 pnt) ; match insertion point
'(72 . 0) ; 0=10 as insertion point
)
)
; attrib #2
(entmake
(list
'(0 . "ATTRIB")
(cons 10 elevdir) ; insertion point
(cons 8 clayer2) ; layer
(cons 1 (rtos ELEV 2 2)) ; 1=default value
'(2 . "ELEV2") ; 2=Tag
(cons 40 htx) ; height
'(70 . 0) ; attribute flags
(cons 41 wdy) ; width
(cons 7 styname) ; text style
(cons 11 elevdir) ; insertion point
'(72 . 0) ; 0=10 as insertion point
)
)
(entmake '((0 . "SEQEND")))
Solved! Go to Solution.