0 Members and 1 Guest are viewing this topic.
(defun ins-meblock (/ get-mspace ins_pt blk me_block) (vl-load-com) (defun get-mspace () (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object) ) ) ) (setq ins_pt (getpoint "\nPlease pick an insertion point: ")) (if (setq blk_name (getstring T "\nEnter Block name (without ext.): ")) (if (findfile (strcat blk_name ".dwg")) (setq me_block (vla-insertblock (get-mspace) (vlax-3d-point ins_pt) blk_name 1.0 1.0 1.0 0.0 ) ) ) ) (if me_block (if (not (vlax-object-released-p me_block)) (vlax-release-object me_block) ) ) (princ) )
(defun ins-meblock (/ get-mspace ins_pt blk me_block) (vl-load-com) (defun get-mspace () (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object) ) ) ) (setq ins_pt (getpoint "\nPlease pick an insertion point: ")) (if (setq blk_name (strcat (getstring T "\nEnter Block name (without ext.): ")".dwg")) (if (findfile blk_name ) ;(if (findfile (strcat blk_name ".dwg")) (setq me_block (vla-insertblock (get-mspace) (vlax-3d-point ins_pt) blk_name 1.0 1.0 1.0 0.0 ) ) ) ) (if me_block (if (not (vlax-object-released-p me_block)) (vlax-release-object me_block) ) ) (princ) )
Name String; input-onlyThe name of the AutoCAD drawing file or the name of the block to insert. If it is a file name, include any path information necessary for AutoCAD to find the file and the .dwg extension.