in the following command
(defun c:ddd ()
(command "-insert")
(princ)
)
i need to use it as bellow :
a. the block name : not user specified / the current
if the current block name is empty -> function halts / stops / exits
b. Insertion point : user specified on screen
c: scale : opposite corner specified on screen
d: rotation : not user specified / use always the default 0 value
How must i write the command to work as above defined?
Gery
Solved! Go to Solution.
Solved by Kent1Cooper. Go to Solution.
You might start with:
(Defun C:ICB ()
(if (and (/= "" (getvar "insname")) ; could use a name
; since using last name is risky
(setq BIP (getpoint "\n Insert Point: "))
(setq BCP (getcorner BIP " Oppo Corner: ") )
) ; ands
(progn(princ "\n Inserting: ")(princ (getvar "insname"))
; could rescale the 'corner point for a proportional scale
; or just a X or a Y scale
(command "-insert" "" BIP "c" bcp "" ) ; deault name
; respond to attribute queries here, if req'd
; finsh insert command, if req'd
(princ " Inserted ")
) (prince " Nyet ") ) (princ ) ) ; def
thanks
i use it as following
(defun c:ddd ()
(if (/= "" (getvar "insname"))
(
(command "-insert" "")
)
)
(princ)
)
that is solving the problem of the null insname
the problem with the part of your code that changes the -insert command is that you have to scale the block without viewing it scalling in real time as -insert does.
What "-insert" needs is just at the last moment of the execution (when asks rotation) to abort the user definition by keyboard and use th value of 0 because this is the only value that i want to use.
Is it possible ?
Regards,
Gery
@GeryKnee wrote:
....
What "-insert" needs is just at the last moment of the execution (when asks rotation) to abort the user definition by keyboard and use th value of 0 because this is the only value that i want to use.
Is it possible ?
....
You can specify the Rotation as an option beforehand, and it won't ask for it later:
(command "_.insert" "YourBlockName" "_rotate" 0 ...carry on with whatever else...)