试着运行了依稀,生成的代码如下,但就是不知道怎样使用?
(defun MakeBlock-jt (/ obj obj1 obj2 objHatch HatchobjAray ) (setvar "clayer" "0") (setq obj (GXL-AX:ADDBLOCK '(0 0 0) "jt")) (setq obj1 (GXL-AX:ADDLINE obj '(-1.0 0.0 0.0) '(1.0 0.0 0.0))) (vla-put-color (vla-item (vla-get-Layers *ACDOCUMENT*) "0") "7") (vla-put-color obj1 "256") (setq axErr (VL-CATCH-ALL-APPLY 'vla-load (list (vla-get-Linetypes *ACDOCUMENT*) "ByLayer" "acadiso.lin"))) (if (VL-CATCH-ALL-ERROR-P axErr) (setq axErr (VL-CATCH-ALL-APPLY 'vla-load (list (vla-get-Linetypes *ACDOCUMENT*) "ByLayer" "EstateCADTools.lin")))) (if (not (VL-CATCH-ALL-ERROR-P axErr)) (vla-put-linetype obj1 "ByLayer")) (vla-put-LinetypeScale obj1 1) (setq obj1 (vla-AddLightWeightPolyline obj (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-vbdouble (cons 1 4))'(-0.459619 -0.459619 0.459619 0.459619))))) (vla-put-color (vla-item (vla-get-Layers *ACDOCUMENT*) "0") "7") (vla-put-color obj1 "256") (vla-put-ConstantWidth obj1 0.45) (setq axErr (VL-CATCH-ALL-APPLY 'vla-load (list (vla-get-Linetypes *ACDOCUMENT*) "ByLayer" "acadiso.lin"))) (if (VL-CATCH-ALL-ERROR-P axErr) (setq axErr (VL-CATCH-ALL-APPLY 'vla-load (list (vla-get-Linetypes *ACDOCUMENT*) "ByLayer" "EstateCADTools.lin")))) (if (not (VL-CATCH-ALL-ERROR-P axErr)) (vla-put-linetype obj1 "ByLayer")) (vla-put-LinetypeScale obj1 1) )
|