Hello everyone!
I am struggling to find the problem in the below lisp file :
Code:
(defun c:TestPP ()
(prinC "\n TestPP : V : 1 . 04 . 2019 ;")
(setVar "TextStyle" "Standard")
(vl-CmdF "_.Purge" "_A" "" "_N")
(if (tblSearch "Block" "PxT")
(princ "\n Block Existed !")
(progn ; Define Block
; (setVar "TextStyle" "Standard")
; (vl-CmdF "_.Purge" "_A" "" "_N")
(command "_.Layer" "_N" "Name L" "_C" 1 "Name L" "")
(if (tblSearch "Style" "ArialT") T (vl-CmdF "_.Style" "ArialT" "Arial.ttf" 0 1 0 "_N" "_N") ) ;
(entMake '((0 . "BLOCK") (2 . "PxT") (70 . 2) (8 . "0") (10 0 0 0) (6 . "ByLayer") (62 . 256) (4 . "Made by Me")) ) ; end of e
(entMake (list '(0 . "Circle") '(8 . "0") '(62 . 256) '(6 . "ByLayer") '(10 0 0 0) (cons 40 0.25) ) ) ; end of e
(entMake (list '(0 . "AttDef") '(100 . "AcDbEntity") (cons 8 "0 Name") '(62 . 256) '(6 . "ByLayer") ;'(67 . 0)
'(100 . "AcDbText") '(10 0 0 0) '(40 . 1.5) '(1 . "N") '(50 . 0) '(41 . 1) '(51 . 0) '(7 . "ArialT") '(71 . 0) '(72 . 0)
'(11 0.5 +1.0 0) '(210 0.0 0.0 1.0)
'(100 . "AcDbAttributeDefinition") '(280 . 0) '(3 . "Point Name") '(2 . "NAME") '(70 . 0) '(73 . 0) '(74 . 2) '(280 . 1) ) ) ; end of e '(100 . "AcDbXrecord")
(entMake '((0 . "EndBlk") (8 . "0")) ) ; end of e
(prinC "\n Block with Attributes DEFINED : PxT ;") ; end of p
) ; else
) ; if
(setq i 0)
(repeat 10 ; Inserting 10 Blocks with Attribute
(entMake (list '(0 . "Insert") '(2 . "PxT") '(8 . "0") '(66 . 1) (cons 10 (trans (list i i i) 1 0)) '(50 . 0) '(41 . 1.0) '(42 . 1.0) '(43 . 1.0)) ) ; inserare Bloc
(entMake (list '(0 . "ATTRIB") '(100 . "AcDbEntity") '(8 . "Name L") '(67 . 0) ;'(6 . "ByLayer") ;'(62 . 256) '(67 . 0) ;0 = MSpace ;
'(100 . "AcDbText") (list 10 i i i) '(40 . 1) (cons 1 (ItoA i)) '(50 . 0) '(41 . 1.0) '(51 . 0.0) '(7 . "ArialT") '(71 . 0)
(cons 72 0) (cons 11 (trans (list i i i) 1 0)) ;'(210 0.0 0.0 1.0)
'(100 . "AcDbAttribute") '(280 . 0) '(2 . "NAME") '(70 . 0) '(73 . 0) (cons 74 2) '(280 . 1) ) ) ; set Attribute
;;; (entMake (list '(0 . "ATTRIB") (list 10 i i i) '(8 . "Name L") (cons 1 (ItoA i)) '(280 . 0) '(2 . "DENUMIRE") '(40 . 1) '(70 . 0);;; (cons 11 (trans (list i i i) 1 0)) (cons 72 0) (cons 74 2) '(6 . "ByLayer") '(7 . "ArialT") '(50 . 0) '(62 . 256) '(280 . 1) ) ) ; e
(entMake '((0 . "SeqEnd") (8 . "0")) ) ; End Insert Block !
(setq i (1+ i))
) ; r
(prinC (strCat "\n Inserted : " (ItoA i) " ;"))
(prinC "\n TestPP : END ;") (prinC)
) ; defun
1 . So , open a new Autocad file , load and run the program .
2 . delete everything and run the code again .
The attributes are not visible .
What is the problem ? Text Style or Insertion of Attribute definition ?
If I remove all the dxf codes 100 , the TextStyle is working fine , but the dxf codes 280 for LockPosition , is not working .
Thanks in advance !