View Full Version : Attributes and dynamic blocks not working with LSP
ReachAndre
2007-10-25, 04:30 PM
Hello all,
When I use a defun to insert a block with attribute, I can not move th attribute without nursting or exploding the block
When I use a defun to insert a dynamic block, I can not use the DYNAMIC part of the block.
Thanks all for your help,
Andre
irneb
2008-02-01, 06:59 AM
You'll have to use either the (command ".-INSERT" ...) function or use the ActiveX. Either from another programming language such as VB, or as macro in AutoCAD VBA, or using the (vlax-...) functions in LISP to call the ActiveX methods / properties, e.g:
;; Get ActiveX Model Space object
(setq MS (vla-get-ModelSpace
(vla-get-ActiveDocument (vlax-get-Acad-Object))
) ;_ end of vla-get-ModelSpace
) ;_ end of setq
;; Create an array for the insertion point (instead of a list)
(setq insP (vlax-make-safearray vlax-vbDouble '(0 . 2)))
;; Insert values into point array
(vlax-safearray-fill insP '(166975.0468 58350.5719 0.0))
(setq blkobj
(vlax-invoke-method
MS ;Model space object
'InsertBlock ;ActiveX method name
insP ;Insertion point array
"win-1x2-of" ;Block name
1.0 ;XScale optional
1.0 ;YScale optional
1.0 ;ZScale optional
0.0 ;Rotation optional
) ;_ end of vlax-invoke-method
) ;_ end of setq
Hello all,
When I use a defun to insert a block with attribute, I can not move th attribute without nursting or exploding the block
When I use a defun to insert a dynamic block, I can not use the DYNAMIC part of the block.
Thanks all for your help,
Andre
Are you setting the three scales (x, y, and z) the same? Dynamic properties will not work if these three scales are different.
kennet.sjoberg
2008-02-05, 09:47 PM
. . .I can not move th attribute without nursting or exploding the block. . .
Try to uncheck the
[ ] Lock position in block
when using ATTDEF
: ) Happy Computing !
kennet
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.