Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Multiple offset distance settings?

27 REPLIES 27
Reply
Message 1 of 28
Anonymous
886 Views, 27 Replies

Multiple offset distance settings?

Is there a lisp routine that can retain multiple offset distances?

Example: have the offset command have multiple start commands: O1, O2, O3,
O4

When you type O1 it prompts (command prompt) you for a offset distance or
return to except the current default in brackets.
When you type O2 it prompts (command prompt) you for a offset distance or
return to except the current default in brackets.
etc.

Many times I have need to offset things say 2 3/4" and others 1 1/2"
....sometimes toggling back and forth but keying in the new distance each
time it changes.

Thanks
27 REPLIES 27
Message 2 of 28
jbecker-vector
in reply to: Anonymous

something like this?

joe
Message 3 of 28
_gile
in reply to: Anonymous

Hi

Here's a way :

(defun c:O1 (/ off_dist)
(if (not
(setq off_dist
(getdist "\nSpecify offset distance or < 2 3/4\" >: ")
)
)
(setq off_dist "10/4")
)
(command "_offset" off_dist pause pause)
(princ)
)

I'm not very at ease with fractinnal units. Message was edited by: gile


Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 4 of 28
Anonymous
in reply to: Anonymous

Here's a slightly shorter way of doing it. As in Joe's, you type O1, O2,
etc. for each one, but this only has to spell out the prompt once in each,
and doesn't set OFFSETDIST first and then accept it in the (command), but
rather just puts the value in there inside the command. Also, mine uses
(getdist) instead of (getreal), so you can pick the distance with two points
on-screen instead of always having to type it, if you want. Gile's doesn't
cover multiple values, and shouldn't localize the variable (because then you
have to establish it again the next time), and doesn't allow for offsetting
lots of things within one operation, and has a fixed default instead of
retaining the new default after the user has established one.

You could even have this save the four values so they'd still be there the
next time you open the drawing, if you have enough USERRx system variables
available to do it.
--
Kent Cooper


"ADK" wrote...
Is there a lisp routine that can retain multiple offset distances?

Example: have the offset command have multiple start commands: O1, O2, O3,
O4

When you type O1 it prompts (command prompt) you for a offset distance or
return to except the current default in brackets.
When you type O2 it prompts (command prompt) you for a offset distance or
return to except the current default in brackets.
etc.

Many times I have need to offset things say 2 3/4" and others 1 1/2"
....sometimes toggling back and forth but keying in the new distance each
time it changes.

Thanks
Message 5 of 28
Anonymous
in reply to: Anonymous

Hi Kent,

IMHO, the code you are proposing can be improved by using vl-bb-set and
vl-bb-ref [something like (vl-bbset 'ofsdist1 ofsdistprompt) and (vl-bb-ref
'ofsdist1)], instead of using(setq ...). This way the variables ofsdist1 to
ofsdist4 will be available to all documents (existing and new) for the
active AutoCAD session.

Constantin

"Kent Cooper" a écrit dans le message de
news: 5332941@discussion.autodesk.com...
Here's a slightly shorter way of doing it. As in Joe's, you type O1, O2,
etc. for each one, but this only has to spell out the prompt once in each,
and doesn't set OFFSETDIST first and then accept it in the (command), but
rather just puts the value in there inside the command. Also, mine uses
(getdist) instead of (getreal), so you can pick the distance with two points
on-screen instead of always having to type it, if you want. Gile's doesn't
cover multiple values,
and shouldn't localize the variable (because then you
have to establish it again the next time), and doesn't allow for offsetting
lots of things within one operation, and has a fixed default instead of
retaining the new default after the user has established one.

You could even have this save the four values so they'd still be there the
next time you open the drawing, if you have enough USERRx system variables
available to do it.
--
Kent Cooper


"ADK" wrote...
Is
there a lisp routine that can retain multiple offset distances?

Example: have the offset command have multiple start commands: O1, O2, O3,
O4

When you type O1 it prompts (command prompt) you for a offset distance or
return to except the current default in brackets.
When you type O2 it prompts (command prompt) you for a offset distance or
return to except the current default in brackets.
etc.

Many times I have need to offset things say 2 3/4" and others 1 1/2"
...sometimes toggling back an
d forth but keying in the new distance each
time it changes.

Thanks
Message 6 of 28
Anonymous
in reply to: Anonymous

You could also use (vl-propagate VarName) to share a variable with all
drawings. Then you can just use the variable without haveing to grab it
from the back board.

FYI...

--

Tim
"A blind man lets nothing block his vision."


"Constantin" wrote in message
news:5332976@discussion.autodesk.com...
Hi Kent,

IMHO, the code you are proposing can be improved by using vl-bb-set and
vl-bb-ref [something like (vl-bbset 'ofsdist1 ofsdistprompt) and (vl-bb-ref
'ofsdist1)], instead of using(setq ...). This way the variables ofsdist1 to
ofsdist4 will be available to all documents (existing and new) for the
active AutoCAD session.

Constantin

"Kent Cooper" a écrit dans le message de
news: 5332941@discussion.autodesk.com...
Here's a slightly shorter way of doing it. As in Joe's, you type O1, O2,
etc. for each one, but this only has to spell out the prompt once in each,
and doesn't set OFFSETDIST first and then accept it in the (command), but
rather just puts the value in there inside the command. Also, mine uses
(getdist) instead of (getreal), so you can pick the distance with two points
on-screen instead of always having to type it, if you want. Gile's doesn't
cover multiple values,
and shouldn't localize the variable (because then you
have to establish it again the next time), and doesn't allow for offsetting
lots of things within one operation, and has a fixed default instead of
retaining the new default after the user has established one.

You could even have this save the four values so they'd still be there the
next time you open the drawing, if you have enough USERRx system variables
available to do it.
--
Kent Cooper


"ADK" wrote...
Is
there a lisp routine that can retain multiple offset distances?

Example: have the offset command have multiple start commands: O1, O2, O3,
O4

When you type O1 it prompts (command prompt) you for a offset distance or
return to except the current default in brackets.
When you type O2 it prompts (command prompt) you for a offset distance or
return to except the current default in brackets.
etc.

Many times I have need to offset things say 2 3/4" and others 1 1/2"
...sometimes toggling back an
d forth but keying in the new distance each
time it changes.

Thanks
Message 7 of 28
Anonymous
in reply to: Anonymous

this lets you enter variable distances until you escape out. if you know
you want to repeat the same distance, say, 5 times for, say, 9' then enter
*5 9 and 5 offsets of 9' will be executed.

alex


"ADK" wrote in message
news:5332846@discussion.autodesk.com...
Is there a lisp routine that can retain multiple offset distances?

Example: have the offset command have multiple start commands: O1, O2, O3,
O4

When you type O1 it prompts (command prompt) you for a offset distance or
return to except the current default in brackets.
When you type O2 it prompts (command prompt) you for a offset distance or
return to except the current default in brackets.
etc.

Many times I have need to offset things say 2 3/4" and others 1 1/2"
....sometimes toggling back and forth but keying in the new distance each
time it changes.

Thanks
Message 8 of 28
mkweaver01
in reply to: Anonymous

This isn't exactly what you are looking for, but I find it helpfull:

;;; Offset distances by sixteenths
(defun c:OF1()(ezoffset 0.0625))
(defun c:OF2()(ezoffset 0.125))
(defun c:OF3()(ezoffset 0.1875))
(defun c:OF4()(ezoffset 0.25))
(defun c:OF5()(ezoffset 0.3125))
(defun c:OF6()(ezoffset 0.375))
(defun c:OF7()(ezoffset 0.4375))
(defun c:OF8()(ezoffset 0.5))
(defun c:OF9()(ezoffset 0.5625))
(defun c:OF10()(ezoffset 0.625))
(defun c:OF11()(ezoffset 0.6875))
(defun c:OF12()(ezoffset 0.75))
(defun c:OF13()(ezoffset 0.8125))
(defun c:OF14()(ezoffset 0.875))
(defun c:OF15()(ezoffset 0.9375))

;;; Offsets by inches
(defun c:O1()(ezoffset 1))
(defun c:O1F8()(ezoffset 1.5))
(defun c:O1F12()(ezoffset 1.75))
(defun c:O2()(ezoffset 2))
(defun c:O3()(ezoffset 3))
(defun c:O3F8()(ezoffset 3.5))
(defun c:O4()(ezoffset 4))
(defun c:O5()(ezoffset 5))
(defun c:O5F8()(ezoffset 5.5))
(defun c:O6()(ezoffset 6))
(defun c:O7()(ezoffset 7))
(defun c:O8()(ezoffset 8))
(defun c:O9()(ezoffset 9))
(defun c:O10()(ezoffset 10))
(defun c:O11()(ezoffset 11))
(defun c:O12()(ezoffset 12))
(defun c:O13()(ezoffset 13))
(defun c:O14()(ezoffset 14))
(defun c:O15()(ezoffset 15))
(defun c:O16()(ezoffset 16))
(defun c:O17()(ezoffset 17))
(defun c:O18()(ezoffset 18))
(defun c:O19()(ezoffset 19))
(defun c:O20()(ezoffset 20))
(defun c:O21()(ezoffset 21))
(defun c:O22()(ezoffset 22))
(defun c:O23()(ezoffset 23))
(defun c:O24()(ezoffset 24))
(defun c:O30()(ezoffset 30))
(defun c:O36()(ezoffset 36))
(defun c:O42()(ezoffset 42))
(defun c:O48()(ezoffset 48))
(defun c:O60()(ezoffset 60))
(defun c:O72()(ezoffset 72))
(defun c:O84()(ezoffset 84))
(defun c:O96()(ezoffset 96))
(defun c:O108()(ezoffset 108))
(defun c:O120()(ezoffset 120))
(defun c:O132()(ezoffset 132))
(defun c:O144()(ezoffset 144))
(defun c:O156()(ezoffset 156))
(defun c:O168()(ezoffset 168))
(defun c:O180()(ezoffset 180))
(defun c:O240()(ezoffset 240))
(defun c:O360()(ezoffset 360))
(defun c:O480()(ezoffset 480))


(defun ezoffset(
dist
/
offsetdist
)
(setq offsetdist (getvar "offsetdist"))
(setvar "offsetdist" dist)
(command "offset" dist)
(while (wcmatch (getvar "cmdnames") "*offset*")
(command pause)
)
(setvar "offsetdist" offsetdist)
(princ)
)
Message 9 of 28
Anonymous
in reply to: Anonymous

Hi Tim,

I didn't want to emphasize on the use of the blackboard variables, but
rather on the idea of having these variables available in all drawings.
Maybe I am wrong, but the reason I preach vl-bb-set and vl-bb-ref each time,
is because I think that for most people asking this kind of stuff on this
NG, the idea of propagating a variable over all documents is much more
abstract and difficult to "visualize" than the idea of putting something
somewhere and getting it later from there.

Regards,

Constantin



"T.Willey" a écrit dans le message de news:
5332967@discussion.autodesk.com...
You could also use (vl-propagate VarName) to share a variable with all
drawings. Then you can just use the variable without haveing to grab it
from the back board.

FYI...

--

Tim
"A blind man lets nothing block his vision."


"Constantin" wrote in message
news:5332976@discussion.autodesk.com...
Hi Kent,

IMHO, the code you are proposing can be improved by using vl-bb-set and
vl-bb-ref [something like (vl-bbset 'ofsdist1 ofsdistprompt) and (vl-bb-ref
'ofsdist1)], instead of using(setq ...). This way the variables ofsdist1 to
ofsdist4 will be available to all documents (existing and new) for the
active AutoCAD session.

Constantin

"Kent Cooper" a écrit dans le message de
news: 5332941@discussion.autodesk.com...
Here's a slightly shorter way of doing it. As in Joe's, you type O1, O2,
etc. for each one, but this only has to spell out the prompt once in each,
and doesn't set OFFSETDIST first and then accept it in the (command), but
rather just puts the value in there inside the command. Also, mine uses
(getdist) instead of (getreal), so you can pick the distance with two points
on-screen instead of always having to type it, if you want. Gile's doesn't
cover multiple values,
and shouldn't localize the variable (because then you
have to establish it again the next time), and doesn't allow for offsetting
lots of things within one operation, and has a fixed default instead of
retaining the new default after the user has established one.

You could even have this save the four values so they'd still be there the
next time you open the drawing, if you have enough USERRx system variables
available to do it.
--
Kent Cooper


"ADK" wrote...
Is
there a lisp routine that can retain multiple offset distances?

Example: have the offset command have multiple start commands: O1, O2, O3,
O4

When you type O1 it prompts (command prompt) you for a offset distance or
return to except the current default in brackets.
When you type O2 it prompts (command prompt) you for a offset distance or
return to except the current default in brackets.
etc.

Many times I have need to offset things say 2 3/4" and others 1 1/2"
...sometimes toggling back an
d forth but keying in the new distance each
time it changes.

Thanks
Message 10 of 28
Anonymous
in reply to: Anonymous

Constantin,

I just didn't know if you had used it before or not, so I thought it was
worth a mention. I have no problem with you telling people one way, I just
like having a variety.

--

Tim
"A blind man lets nothing block his vision."


"Constantin" wrote in message
news:5333010@discussion.autodesk.com...
Hi Tim,

I didn't want to emphasize on the use of the blackboard variables, but
rather on the idea of having these variables available in all drawings.
Maybe I am wrong, but the reason I preach vl-bb-set and vl-bb-ref each time,
is because I think that for most people asking this kind of stuff on this
NG, the idea of propagating a variable over all documents is much more
abstract and difficult to "visualize" than the idea of putting something
somewhere and getting it later from there.

Regards,

Constantin



"T.Willey" a écrit dans le message de news:
5332967@discussion.autodesk.com...
You could also use (vl-propagate VarName) to share a variable with all
drawings. Then you can just use the variable without haveing to grab it
from the back board.

FYI...

--

Tim
"A blind man lets nothing block his vision."


"Constantin" wrote in message
news:5332976@discussion.autodesk.com...
Hi Kent,

IMHO, the code you are proposing can be improved by using vl-bb-set and
vl-bb-ref [something like (vl-bbset 'ofsdist1 ofsdistprompt) and (vl-bb-ref
'ofsdist1)], instead of using(setq ...). This way the variables ofsdist1 to
ofsdist4 will be available to all documents (existing and new) for the
active AutoCAD session.

Constantin

"Kent Cooper" a écrit dans le message de
news: 5332941@discussion.autodesk.com...
Here's a slightly shorter way of doing it. As in Joe's, you type O1, O2,
etc. for each one, but this only has to spell out the prompt once in each,
and doesn't set OFFSETDIST first and then accept it in the (command), but
rather just puts the value in there inside the command. Also, mine uses
(getdist) instead of (getreal), so you can pick the distance with two points
on-screen instead of always having to type it, if you want. Gile's doesn't
cover multiple values,
and shouldn't localize the variable (because then you
have to establish it again the next time), and doesn't allow for offsetting
lots of things within one operation, and has a fixed default instead of
retaining the new default after the user has established one.

You could even have this save the four values so they'd still be there the
next time you open the drawing, if you have enough USERRx system variables
available to do it.
--
Kent Cooper


"ADK" wrote...
Is
there a lisp routine that can retain multiple offset distances?

Example: have the offset command have multiple start commands: O1, O2, O3,
O4

When you type O1 it prompts (command prompt) you for a offset distance or
return to except the current default in brackets.
When you type O2 it prompts (command prompt) you for a offset distance or
return to except the current default in brackets.
etc.

Many times I have need to offset things say 2 3/4" and others 1 1/2"
...sometimes toggling back an
d forth but keying in the new distance each
time it changes.

Thanks
Message 11 of 28
Anonymous
in reply to: Anonymous

(Sorry, Constantin & Tim, vl-whatever is beyond my current abilities, but
those sound like excellent suggestions. I had the attached already adjusted
before I saw your messages, but would be happy to know how to incorporate
them.)

Here's a refined version. Since the value of "OFFSETDIST" is -1 for
"Through", it might be confusing to Users to see that -1 value in the
prompt, so this checks for that and puts the text string "Through" in there
instead.

Also, I tried it out, and found I had a hard time remembering which offset
command was which, when they are numbered and the offset distances are also
numerical (was it O3 that was the 3-5/8" one, and O1 the 2-1/2" one,
or...?). So I changed them to letters OA, OB, etc. I think this also makes
it less likely that someone will try to type in 01 (zero-one) mistakenly as
I did a few times, instead of O1.

And I expanded it to five values, A through E.
--
Kent Cooper
Message 12 of 28
Anonymous
in reply to: Anonymous

Kent,

Assumeing looking at your code that 'ofsdistE' is your global variable for
the offset distance, you could do
(vl-propagate 'ofsdistE)
This will set the variable 'ofsdistE' in all drawings (opened, to be
opened). Or the way Constantin shows, you would do
(vl-bb-set 'ofsdistE ofsdistE1)
to set it within your functions, and then use
(vl-bb-ref 'ofsdistE)
to get the value back.

I think (vl-propagate .. ) is easier to use as you can call the variable
just like you would use anyother variable.

--

Tim
"A blind man lets nothing block his vision."


"Kent Cooper" wrote in message
news:5333014@discussion.autodesk.com...
(Sorry, Constantin & Tim, vl-whatever is beyond my current abilities, but
those sound like excellent suggestions. I had the attached already adjusted
before I saw your messages, but would be happy to know how to incorporate
them.)

Here's a refined version. Since the value of "OFFSETDIST" is -1 for
"Through", it might be confusing to Users to see that -1 value in the
prompt, so this checks for that and puts the text string "Through" in there
instead.

Also, I trie
d it out, and found I had a hard time remembering which offset
command was which, when they are numbered and the offset distances are also
numerical (was it O3 that was the 3-5/8" one, and O1 the 2-1/2" one,
or...?). So I changed them to letters OA, OB, etc. I think this also makes
it less likely that someone will try to type in 01 (zero-one) mistakenly as
I did a few times, instead of O1.

And I expanded it to five values, A through E.
--
Kent Cooper
Message 13 of 28
Anonymous
in reply to: Anonymous

If you change your variable, you have to proagate it again, so that the new
value will be seen in the other drawings. I didn't think you had to do
this, but I just tested it, and you do.

--

Tim
"A blind man lets nothing block his vision."


"T.Willey" wrote in message
news:5333041@discussion.autodesk.com...
Kent,

Assumeing looking at your code that 'ofsdistE' is your global variable for
the offset distance, you could do
(vl-propagate 'ofsdistE)
This will set the variable 'ofsdistE' in all drawings (opened, to be
opened). Or the way Constantin shows, you would do
(vl-bb-set 'ofsdistE ofsdistE1)
to set it within your functions, and then use
(vl-bb-ref 'ofsdistE)
to get the value back.

I think (vl-propagate .. ) is easier to use as you can call the variable
just like you would use anyother variable.

--

Tim
"A blind man lets nothing block his vision."


"Kent Cooper" wrote in message
news:5333014@discussion.autodesk.com...
(Sorry, Constantin & Tim, vl-whatever is beyond my current abilities, but
those sound like excellent suggestions. I had the attached already adjusted
before I saw your messages, but would be happy to know how to incorporate
them.)

Here's a refined version. Since the value of "OFFSETDIST" is -1 for
"Through", it might be confusing to Users to see that -1 value in the
prompt, so this checks for that and puts the text string "Through" in there
instead.

Also, I trie
d it out, and found I had a hard time remembering which offset
command was which, when they are numbered and the offset distances are also
numerical (was it O3 that was the 3-5/8" one, and O1 the 2-1/2" one,
or...?). So I changed them to letters OA, OB, etc. I think this also makes
it less likely that someone will try to type in 01 (zero-one) mistakenly as
I did a few times, instead of O1.

And I expanded it to five values, A through E.
--
Kent Cooper
Message 14 of 28
cyberiq
in reply to: Anonymous

Here is your function Kent,

Constantin
Message 15 of 28
Anonymous
in reply to: Anonymous

Sorry about the name, ouor server has some problems, so I has to use the
Web, where my acount is configured like this for a long time. I will avoid
using it again...

Constantin

a écrit dans le message de news:
5333065@discussion.autodesk.com...
Here is your function Kent,

Constantin
Message 16 of 28
Anonymous
in reply to: Anonymous

In the other proposed way, the number of code lines remain the same, the
variables name remain the same, the only changes are:


(cond (ofsdistA (setq ofsdistprompt (rtos ofsdistA 4 4)))

becomes

(cond ((vl-bb-ref ' ofsdistA)(setq ofsdistprompt (rtos (vl-bb-ref '
ofsdistA) 4 4)))

and

(if ofsdistA1 (setq ofsdistA ofsdistA1))

becomes

(if ofsdistA1 (vl-bb-set 'ofsdistA ofsdistA1))


Constantin



"Kent Cooper" a écrit dans le message de
news: 5333014@discussion.autodesk.com...
(Sorry, Constantin & Tim, vl-whatever is beyond my current abilities, but
those sound like excellent suggestions. I had the attached already adjusted
before I saw your messages, but would be happy to know how to incorporate
them.)

Here's a refined version. Since the value of "OFFSETDIST" is -1 for
"Through", it might be confusing to Users to see that -1 value in the
prompt, so this checks for that and puts the text string "Through" in there
instead.

Also, I trie
d it out, and found I had a hard time remembering which offset
command was which, when they are numbered and the offset distances are also
numerical (was it O3 that was the 3-5/8" one, and O1 the 2-1/2" one,
or...?). So I changed them to letters OA, OB, etc. I think this also makes
it less likely that someone will try to type in 01 (zero-one) mistakenly as
I did a few times, instead of O1.

And I expanded it to five values, A through E.
--
Kent Cooper
Message 17 of 28
Anonymous
in reply to: Anonymous

Marvelous.... Thanks for that productive refinement, and thanks, ADK, for
the original notion. I think it will be useful around here, and I'm going
to distribute it to my users.
--
Kent Cooper


wrote...
Here is your function Kent,

Constantin
Message 18 of 28
Anonymous
in reply to: Anonymous

It may not matter which way it's done, if they're functionally equivalent
from the User's point of view. The vl-propagate way "imposes" those values
on drawings that may not need to use them, but I assume that's not much
overhead to add. If there's any reason to think one way would operate
noticeably faster than the other, that might be worth something, but that
doesn't seem likely.
--
Kent Cooper


"Constantin" wrote...
In the other proposed way, the number of code lines remain the same, the
variables name remain the same, the only changes are:

(cond (ofsdistA (setq ofsdistprompt (rtos ofsdistA 4 4)))

becomes

(cond ((vl-bb-ref ' ofsdistA)(setq ofsdistprompt (rtos (vl-bb-ref '
ofsdistA) 4 4)))

and

(if ofsdistA1 (setq ofsdistA ofsdistA1))

becomes

(if ofsdistA1 (vl-bb-set 'ofsdistA ofsdistA1))

Constantin

.....
Message 19 of 28
Anonymous
in reply to: Anonymous

Hi again Kent,

I was thinking a little more about it and I believe that we should make a
minor change (see bellow example ). I would vl-propagate the variable
before stepping into the offst command itself, because if the user hits
Escape in the middle of the command for whatever reason, the vl-propagate
won't execute anymore, so the (eventualy) new value is lost. It could be
intercepted with some error routine, but it becomes too complicated. The
Escape key could also be hit while within (getdist ...) statement, but at
least, in this case the offset value remains the same old one. So I suggest
this new aproach, but it's up to you to decide which way to go.

(defun C:OA (/ ofsdistA1)

(cond
(ofsdistA (setq ofsdistprompt (rtos ofsdistA 4 4)))
((= (getvar "OFFSETDIST") -1) (setq ofsdistprompt "Through"))
(T (setq ofsdistprompt (rtos (getvar "OFFSETDIST") 4 4)))
);end cond

(setq ofsdistA1 (getdist (strcat "Offset distance A: <" ofsdistprompt ">:
")))

(if ofsdistA1
(setq ofsdistA ofsdistA1)
);end if

(vl-propagate 'ofsdistA)
(command "OFFSET" ofsdistA)
)


Constantin


"Kent Cooper" a écrit dans le message de
news: 5333079@discussion.autodesk.com...
Marvelous.... Thanks for that productive refinement, and thanks, ADK, for
the original notion. I think it will be useful around here, and I'm going
to distribute it to my users.
--
Kent Cooper


wrote...
Here is your function Kent,

Constantin
Message 20 of 28
Anonymous
in reply to: Anonymous

I'm trying out this approach, too. Two questions:

Syntax question -- does the apostrophe really go immediately after
vl-bb-ref, with the space after the apostrophe, or should it be the way you
used vl-bb-set and vl-propagate, where the vl- term is followed by a space,
and the apostrophe precedes the variable name?

And, should I also replace the last function
(command "OFFSET" ofsdistA)
with
(command "OFFSET" (vl-bb-ref 'ofsdistA))
since I don't have a variable ofsdistA within the current drawing, or will
vl-bb-set create that at the same time?

Thanks again,
--
Kent Cooper


"Constantin" wrote...
In the other proposed way, the number of code lines remain the same, the
variables name remain the same, the only changes are:

(cond (ofsdistA (setq ofsdistprompt (rtos ofsdistA 4 4)))

becomes

(cond ((vl-bb-ref ' ofsdistA)(setq ofsdistprompt (rtos (vl-bb-ref '
ofsdistA) 4 4)))

and

(if ofsdistA1 (setq ofsdistA ofsdistA1))

becomes

(if ofsdistA1 (vl-bb-set 'ofsdistA ofsdistA1))

Constantin

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost