Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

entmake block

1 view
Skip to first unread message

Rob Tomson

unread,
Aug 21, 2001, 5:21:06 PM8/21/01
to
as you can tell all i have for reference is the autocad help file which
helps in someways but it's still hard to get around. so until i buy an
autolisp book can someone please help me with this. i have a block with
four lines and one attribute in it but i can't even get past this part.
when issued this command autocad comes back with
"Invalid field type 41 in (entmake)."
i looked it up and field 41 should be the x scale factor, right? once i get
this to work how do i fill in the attribute with something?


(setq EntBlo (entmake (list
(cons 0 "BLOCK")
(cons 2 "SHEAR_DIAMOND")
(cons 8 BloLay)
(cons 10 InsPoi)
(cons 41 DimSca)
(cons 42 DimSca)
(cons 43 DimSca)
(cons 66 1)
)
)
)

thanks (again),
Rob

p.s. is there a good visual lisp book out there somewhere?


Rob Tomson

unread,
Aug 21, 2001, 7:28:05 PM8/21/01
to
oops sorry, my outlook express screwed up on me


Jon Fleming

unread,
Aug 22, 2001, 7:31:38 AM8/22/01
to
There are several different kinds of entities involved in what you're doing.

The entities that make up a block are defined in a BLOCK entity. To (entmake
..) a block, you (entmake ..) the BLOCK entity itself, then you (entmake ...)
the entities that go into the block, then you (entmake ...) an ENDBLK entity
(which really isn't an entity, it just signals AutoCAD that the block is
finished).

Of course, if the block is already defined you skip this step.

If you want to see the block in your drawing, which you essentially always do,
you need to create an insert of that block by entmake'ing an INSERT entity.

Your error message is telling you that you included DXF codes that are not
appropriate for a BLOCK entity. The appropriate DXF codes are covered in the
DXF Reference section of the help file. I don't have any simple code handy to
post, but perhaps someone else will do so.

Attributes introduce a complication. Typically, you (entmake ...) ATTDEF
entities during the block definition (first) phase. If the user ever inserts
the block using the INSERT command, these ATTDEF entities are used as
templates for the ATTRIB entities that go along with the INSERT entity of the
block.

When you (entmake ...) an INSERT with attributes, after entmake'ing the INSERT
entity you must immediately (entmake ...) each individual attribute and then
(entmake ...) a SEQEND entity to end the list of attributes. In this
scenario, there is never any reference to the ATTDEF entities in the block
definition. If (and _only_ if) the block will _only_ be inserted by using
(entmake ...), the ATTDEF entities inside the block definition are superfluous
and may be omitted.

jrf
Member of the Autodesk Discussion Forum Moderator Program
Please do not email questions unless you wish to hire my services

In article <ED2D2A82627BB23F...@in.WebX.maYIadrTaRb>, Rob Tomson
wrote:

0 new messages