Hi,
It looks like you're confusing attribute definition (ATTDEF) and attribute reference (ATTRIB).
An attribute definition is an entity owned by a block definition which serves as pattern to create attribute references. Attribute references are entities linked to block reference.
To enmake an attributed block reference, the pseudo code is
entmake INSERT
[entmake ATTRIB ...]
entmake SEQEND
You should get some inspiration from this routine.Code - Auto/Visual Lisp: [Select]
;;; InsertBlockWithAttributes (Gilles Chanteau) ;;; Creates a new block reference with attributes using entmake ;;; ;;; Arguments ;;; blockName : name of the block definition ;;; inspt : insertion point ;;; layer : insertion layer ;;; xScale : X scale ;;; yScale : Y scale ;;; rotation : rotation (radians) ;;; attribs : list of dotted pairs containing the attribute values (TAG . Value) (defun InsertBlockWithAttributes (blockName insPt layer xScale yScale rotation attribs / mxv block ent attDefs insert tag elst) m ) ) ) ) (while ent ) ) (list ) ) ) ) (list ) ) ) ) ) ) ) )
;;; attribs : list of dotted pairs containing the attribute values (TAG . Value)
Nice function gile!
;;; attribs : list of dotted pairs containing the attribute values (TAG . Value)
Hi Sir,
Can you give me a example code that uses this "attribs" variable to create a block with name: "MV", tagname: "XYScale", value: "10x2"?
I only know a little about lisp.