style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<yC_tedium> a écrit dans le message de news:Martti,
href="mailto:6101745@discussion.autodesk.com">6101745@discussion.autodesk.com...
Can't do it ?... Can I use any kind of compiler to do it also ?_? Jason, Yes,
"arguments" DEVITG, Like those AutoCAD can do. It was coz I searching in the
help files, and saw those many functions form autocad allowing optional
arguments, so I try asking how can I...
Resurrecting an old thread here...
So, I was thinking of passing a block name to a function to insert the block into a drawing. Then an "optional" boolean argument to whether or not it should be scaled according to say LTS or Dimscale (or else just use scale factor of 1). To be used in a menu.
So, according to this thread I would need to define the function w/ 1 arglist variable like:
(Defun InsertBlock (arglist /...)
and my arglist could look somethign like:
'("Blockname" T) or just '(Blockname)
Then
(if (nth 1 arglist)
(setq blockscale (getvar "ltscale"))
(setq blockscale 1)
);if
Seems like too much work and maybe I should just always call the function w/ (insertblock "blockname" t) or (insertblock "blockname" nil) every time.
Anyone else have suggestions?
like.. "Use toolpalettes" perhaps.. haha.
Not the best of examples. Small numbers of arguments and boolean yes/no arguments are almost always better handled with dedicated arguments e.g. (insertABlock "Name" T) and (insertABlock "Name" nil), or pass the desired scale value as a real. If you felt the burning desire to add more code you could create wrapper functions to call a central function with the extra arguments e.g. (insertAnLTSBlock ...) would call (insertABlock "Name" (getvar "LTSCALE")).