- (defun _insert (p bn ang ds)
- ; Author pBe
- ; http://www.cadtutor.net/forum/showthread.php?66836-Inseret-a-group-of-blocks-in-array-with-a-defined-series&p=457386&viewfull=1#post457386
- (vlax-invoke
- (vlax-get
- (vla-get-ActiveLayout
- (vla-get-activedocument
- (vlax-get-acad-object)))
- 'Block)
- 'InsertBlock
- p
- bn
- 1
- 1
- 1
- 0)
- (polar p ang ds)
- )
- (defun c:test ()
- ; Author pBe
- ; http://www.cadtutor.net/forum/showthread.php?66836-Inseret-a-group-of-blocks-in-array-with-a-defined-series&p=457386&viewfull=1#post457386
- (setq blk (getstring T "\nPaste Block Names: "))
- (setq blk (mapcar 'vl-symbol-name (read (strcat "(" blk ")"))))
- (setq pt (getpoint "\nPick Insertion point:"))
-
- (if (not dist)
- (setq dist 1.00))
- (setq dist (cond
- ((getdist
- (strcat "\nEnter Distance <"
- (rtos dist 2 2)
- ">: ")))
- (dist)))
- (if (not angl)
- (setq angl 0.00))
- (setq angl (cond
- ((getangle
- (strcat "\nEnter Angle <"
- (angtos angl 0)
- ">: ")))
- (angl)))
- (foreach
- bn
- blk
- (setq pt (_insert pt bn angl dist)))
- )
粘贴块名称:A B C A B C |