lucas3 发表于 2022-7-5 23:49:58

This code lack a step ,somebod

This code can establish anonymous block,but Missing a step,The lack of specify a basis points,somebody can help me Add this step?

(defun C:NONAME_BLK (/ HOLDECHO HOLDBLIP A AA BLKREF) (command "_.undo" "_group") (setq HOLDECHO (getvar "cmdecho")) (setq HOLDBLIP (getvar "blipmode")) (setvar "cmdecho" 0) (setvar "blipmode" 0) (prompt "\nSelect object to establish anonymous block: ") (setq AA (ssget)) (setq A (rtos (* (getvar "CDATE") 1E8))) (if (/= AA NIL)   (progn   (command "_.BLOCK" A "0,0" AA "")   (command "_.INSERT" A "@" "" "" "")   (setq BLKREF (vlax-ename->vla-object (entlast)))   (vla-put-name(vla-item (vla-get-blocks   (vla-get-activedocument (vlax-get-acad-object))   )   (vla-get-name BLKREF))"*U"   )   (vlax-release-object BLKREF)   )   (alert "\nNot select any object!") ) (setvar "blipmode" HOLDBLIP) (setvar "cmdecho" HOLDECHO) (command "_.undo" "_end") (princ))

pBe 发表于 2022-7-6 00:06:39

(setq AA (ssget))(prompt "\nPick Insertion point ") (setq A (rtos (* (getvar "CDATE") 1E8))) (if (/= AA NIL)   (progn   (command "_.BLOCK" A "\\" AA "")..

lucas3 发表于 2022-7-6 00:24:32

 
Test OK! thank you ! pBe

Lee Mac 发表于 2022-7-6 00:28:36

Looking over the function of your code, you may be interested in the methods demonstrated in these programs.

lucas3 发表于 2022-7-6 00:45:20

Thank you lee ,Web page can't open

Lee Mac 发表于 2022-7-6 00:55:29

http://www.theswamp.org/index.php?topic=45643.msg508165#msg508165
页: [1]
查看完整版本: This code lack a step ,somebod