(entmake (list (cons 0 "BLOCK")
(cons 2 (caar n))
(cons 70 0)
(cons 10 (cadr n))
)
)
(while (< i count_them)
(setq it (cdr (entget (ssname them i))))
(entmake it)
(setq i (+ i 1))
)
(entmake '((0 . "ENDBLK")))
(entmake (list '(0 . "BLOCK") ; required
'(100 . "AcDbEntity") ; recommended
'(100 . "AcDbBlockBegin") ; recommended
(cons 2 blockname) ; required
'(8 . "0") ; recommended
'(70 . 2) ; required [NOTE 0 if no attributes]
'(10 0.0 0.0 0.0) ; required
))
(entmake (list '(0 . "ENDBLK") ; required
'(100 . "AcDbBlockEnd") ; recommended
'(8 . "0") ; recommended
))
(entmake (entget (car (entsel))))
to clone an entity with an extension dictionary, the clone references the same extension dictionary as the original which is 'illegal'.;**************************************
;CREATE PART NUMBER BLOCK
;**************************************
(defun C:partnogen (/ pt01)
(setq partnumber (getstring "\nEnter Part Number: "))
(entmake
(list
(cons 0 "BLOCK") ; entity
(cons 2 partnumber) ; block name
(cons 70 2) ; block type
(list 10 0.0 0.0 0.0) ; base point
) ; end list
) ; end entmake
(entmake
(list
(cons 0 "TEXT") ; entity
(cons 8 "SYS-Bom_Part_Numbers") ; layer
(list 10 0.0 0.0 0.0) ; base point
(cons 40 0.035) ; text height
(cons 1 partnumber) ; text string
(cons 50 0) ; text rotation
; (cons 7 "STANDARD") ; text style
(cons 72 10) ; text justification
) ; end list
) ; end entmake text
;**************************************
;START ANNOTATIVE / NO EXPLODE SEQUENCE
;**************************************
(entmake
(list
(cons 0 "ENDBLK")
(cons 8 "0")
)
)
(
(lambda ( lst )
(regapp "ACAD")
(regapp "AcadAnnotative")
(entmod
(append (subst (cons 70 1) (assoc 70 lst) lst)
(list
(list -3
(list "ACAD"
(cons 1000 "DesignCenter Data")
(cons 1002 "{")
(cons 1070 1)
(cons 1070 1)
(cons 1002 "}")
)
(list "AcadAnnotative"
(cons 1000 "AnnotativeData")
(cons 1002 "{")
(cons 1070 1)
(cons 1070 1)
(cons 1002 "}")
)
)
)
)
)
)
(entget (cdr (assoc 330 (entget (tblobjname "BLOCK" partnumber)))))
)
(vl-load-com)
(setq BLOCKS
(vla-get-Blocks
(vla-get-activedocument
(vlax-get-acad-object)
)
)
BLK (vla-Item BLOCKS partnumber)
)
(vla-put-explodable (vla-Item BLOCKS partnumber) :vlax-false)
(princ)
) ; end function
(while (< i count_them)
(if (not (assoc 66 (setq it (cdr (entget (ssname them i))))))
(entmake it)
)
(setq i (+ i 1))
)
The big question is of course: Why not use the BLOCK command?
The big question is of course: Why not use the BLOCK command?