您需要提供要插入块的块VLA对象(即模型/图纸空间、块定义)。
这一点需要是一个变体。
例如:
- (defun InsertBlock (bNme Pt)
- (vl-load-com)
- ;; Lee Mac ~ 05.03.10
- (vla-InsertBlock
- (if (eq acPaperSpace
- (vla-get-ActiveSpace
- (setq doc (vla-get-ActiveDocument
- (vlax-get-acad-object)))))
-
- (if (eq :vlax-true (vla-get-MSpace doc))
- (vla-get-ModelSpace doc)
- (vla-get-PaperSpace doc))
- (vla-get-ModelSpace doc))
- (vlax-3D-point Pt) bNme 1. 1. 1. 0.))
- (defun c:test (/ iPt file)
- (if (and (setq iPt (getpoint "\nPick point for Block: "))
- (setq file (findfile "L:\\DrawingUtilities\\F-Part.dwg")))
-
- (InsertBlock file iPt))
- (princ))
|