Entsel in scripts

Entsel in scripts

Anonymous
Not applicable
492 Views
13 Replies
Message 1 of 14

Entsel in scripts

Anonymous
Not applicable
I have a lisp routine that uses entsel to ask the user for a selection. When
I run the routine in a script, the script does not wait for the selection
and the entsel recieves the next script command as its input, causing an
error.
Is there any way to have the script pause until the lisp routine is
completed?
Thanks again,
Jon Crouch.
0 Likes
493 Views
13 Replies
Replies (13)
Message 2 of 14

Anonymous
Not applicable
Hello Jon, I'm Rudy.

Why not use 'nentselp' .

Have your script search for the entity you wish to acquire, then extract
the point of insertion or point of reference, then assign it to the
nentselp. There by allowing it to rebuild the script and continuing.

--
Rudy@whainc.com
Programmer/Developer/MIS Assist.

Jon Crouch wrote in article
<7uibj7$t5v19@adesknews2.autodesk.com>...
> I have a lisp routine that uses entsel to ask the user for a selection.
When
> I run the routine in a script, the script does not wait for the selection
> and the entsel recieves the next script command as its input, causing an
> error.
> Is there any way to have the script pause until the lisp routine is
> completed?
> Thanks again,
> Jon Crouch.
>
>
>
0 Likes
Message 3 of 14

Anonymous
Not applicable
Rudy Tovar wrote in message
news:01bf1a62$0f74e720$1b09a8c0@mail.whainc.com...
> Hello Jon, I'm Rudy.
>
> Why not use 'nentselp' .
>
> Have your script search for the entity you wish to acquire, then extract
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I have no idea how to do this...the entity will be one of numerous text
items on the dwg and could be at any location.

> the point of insertion or point of reference, then assign it to the
> nentselp. There by allowing it to rebuild the script and continuing.
>
> --
> Rudy@whainc.com
> Programmer/Developer/MIS Assist.
>
>
> Jon Crouch wrote in article
> <7uibj7$t5v19@adesknews2.autodesk.com>...
> > I have a lisp routine that uses entsel to ask the user for a selection.
> When
> > I run the routine in a script, the script does not wait for the
selection
> > and the entsel recieves the next script command as its input, causing an
> > error.
> > Is there any way to have the script pause until the lisp routine is
> > completed?
> > Thanks again,
> > Jon Crouch.
> >
> >
> >
0 Likes
Message 4 of 14

Anonymous
Not applicable
If this is text then have the script search for the text and replace or
modify the given value you wish to change. You will not have to use the
entsel or entselp function if you use 'SSGET' "X".

Jon Crouch wrote in article
<7uihkp$t7b25@adesknews2.autodesk.com>...
>
> Rudy Tovar wrote in message
> news:01bf1a62$0f74e720$1b09a8c0@mail.whainc.com...
> > Hello Jon, I'm Rudy.
> >
> > Why not use 'nentselp' .
> >
> > Have your script search for the entity you wish to acquire, then
extract
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> I have no idea how to do this...the entity will be one of numerous text
> items on the dwg and could be at any location.
>
> > the point of insertion or point of reference, then assign it to the
> > nentselp. There by allowing it to rebuild the script and continuing.
> >
> > --
> > Rudy@whainc.com
> > Programmer/Developer/MIS Assist.
> >
> >
> > Jon Crouch wrote in article
> > <7uibj7$t5v19@adesknews2.autodesk.com>...
> > > I have a lisp routine that uses entsel to ask the user for a
selection.
> > When
> > > I run the routine in a script, the script does not wait for the
> selection
> > > and the entsel recieves the next script command as its input, causing
an
> > > error.
> > > Is there any way to have the script pause until the lisp routine is
> > > completed?
> > > Thanks again,
> > > Jon Crouch.
> > >
> > >
> > >
>
>
>
0 Likes
Message 5 of 14

Anonymous
Not applicable
But I don't know what the text will say..

Rudy Tovar wrote in message
news:01bf1a6b$c763e9e0$1b09a8c0@mail.whainc.com...
> If this is text then have the script search for the text and replace or
> modify the given value you wish to change. You will not have to use the
> entsel or entselp function if you use 'SSGET' "X".
>
>
>
> Jon Crouch wrote in article
> <7uihkp$t7b25@adesknews2.autodesk.com>...
> >
> > Rudy Tovar wrote in message
> > news:01bf1a62$0f74e720$1b09a8c0@mail.whainc.com...
> > > Hello Jon, I'm Rudy.
> > >
> > > Why not use 'nentselp' .
> > >
> > > Have your script search for the entity you wish to acquire, then
> extract
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > I have no idea how to do this...the entity will be one of numerous text
> > items on the dwg and could be at any location.
> >
> > > the point of insertion or point of reference, then assign it to the
> > > nentselp. There by allowing it to rebuild the script and continuing.
> > >
> > > --
> > > Rudy@whainc.com
> > > Programmer/Developer/MIS Assist.
> > >
> > >
> > > Jon Crouch wrote in article
> > > <7uibj7$t5v19@adesknews2.autodesk.com>...
> > > > I have a lisp routine that uses entsel to ask the user for a
> selection.
> > > When
> > > > I run the routine in a script, the script does not wait for the
> > selection
> > > > and the entsel recieves the next script command as its input,
causing
> an
> > > > error.
> > > > Is there any way to have the script pause until the lisp routine is
> > > > completed?
> > > > Thanks again,
> > > > Jon Crouch.
> > > >
> > > >
> > > >
> >
> >
> >
0 Likes
Message 6 of 14

Anonymous
Not applicable
Let me ask you something Jon.

What's the application going to be used for?

Jon Crouch wrote in article
<7uiion$1tt2@adesknews2.autodesk.com>...
> But I don't know what the text will say..
>
> Rudy Tovar wrote in message
> news:01bf1a6b$c763e9e0$1b09a8c0@mail.whainc.com...
> > If this is text then have the script search for the text and replace or
> > modify the given value you wish to change. You will not have to use the
> > entsel or entselp function if you use 'SSGET' "X".
> >
> >
> >
> > Jon Crouch wrote in article
> > <7uihkp$t7b25@adesknews2.autodesk.com>...
> > >
> > > Rudy Tovar wrote in message
> > > news:01bf1a62$0f74e720$1b09a8c0@mail.whainc.com...
> > > > Hello Jon, I'm Rudy.
> > > >
> > > > Why not use 'nentselp' .
> > > >
> > > > Have your script search for the entity you wish to acquire, then
> > extract
> > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > > I have no idea how to do this...the entity will be one of numerous
text
> > > items on the dwg and could be at any location.
> > >
> > > > the point of insertion or point of reference, then assign it to the
> > > > nentselp. There by allowing it to rebuild the script and
continuing.
> > > >
> > > > --
> > > > Rudy@whainc.com
> > > > Programmer/Developer/MIS Assist.
> > > >
> > > >
> > > > Jon Crouch wrote in article
> > > > <7uibj7$t5v19@adesknews2.autodesk.com>...
> > > > > I have a lisp routine that uses entsel to ask the user for a
> > selection.
> > > > When
> > > > > I run the routine in a script, the script does not wait for the
> > > selection
> > > > > and the entsel recieves the next script command as its input,
> causing
> > an
> > > > > error.
> > > > > Is there any way to have the script pause until the lisp routine
is
> > > > > completed?
> > > > > Thanks again,
> > > > > Jon Crouch.
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
>
>
>
0 Likes
Message 7 of 14

Anonymous
Not applicable
Scripts cannot be used interactively so your calls to entsel will fail. If
you must use the routine in a script, you have to replace entsel with
nentselp. Perhaps you can have the lisp routine build a selection set and
then call the script to act on it. But if you're gonna go that far, might as
well let the lisp routine handle the whole operation.

Jon Crouch wrote in message
news:7uibj7$t5v19@adesknews2.autodesk.com...
> I have a lisp routine that uses entsel to ask the user for a selection.
When
> I run the routine in a script, the script does not wait for the selection
> and the entsel recieves the next script command as its input, causing an
> error.
> Is there any way to have the script pause until the lisp routine is
> completed?
> Thanks again,
> Jon Crouch.
>
>
0 Likes
Message 8 of 14

Anonymous
Not applicable
Hello Frank.

You should have followed the thread.

--
Rudy@whainc.com
Programmer/Developer/MIS Assist.

Frank Oquendo wrote in article
<7uir9i$1uv17@adesknews2.autodesk.com>...
> Scripts cannot be used interactively so your calls to entsel will fail.
If
> you must use the routine in a script, you have to replace entsel with
> nentselp. Perhaps you can have the lisp routine build a selection set and
> then call the script to act on it. But if you're gonna go that far, might
as
> well let the lisp routine handle the whole operation.
>
> Jon Crouch wrote in message
> news:7uibj7$t5v19@adesknews2.autodesk.com...
> > I have a lisp routine that uses entsel to ask the user for a selection.
> When
> > I run the routine in a script, the script does not wait for the
selection
> > and the entsel recieves the next script command as its input, causing
an
> > error.
> > Is there any way to have the script pause until the lisp routine is
> > completed?
> > Thanks again,
> > Jon Crouch.
> >
> >
>
>
>
0 Likes
Message 9 of 14

Anonymous
Not applicable
I did. SSGET "X" wasn't going to help him. He seems to be trying to do the
impossible: create an interactive or decision-making script. Neither is
possible. The obvious solution is a LISP routine, not a script.

Rudy Tovar wrote in message
news:01bf1a8f$14b95900$1b09a8c0@mail.whainc.com...
> Hello Frank.
>
> You should have followed the thread.
>
> --
> Rudy@whainc.com
> Programmer/Developer/MIS Assist.
>
> Frank Oquendo wrote in article
> <7uir9i$1uv17@adesknews2.autodesk.com>...
> > Scripts cannot be used interactively so your calls to entsel will fail.
> If
> > you must use the routine in a script, you have to replace entsel with
> > nentselp. Perhaps you can have the lisp routine build a selection set
and
> > then call the script to act on it. But if you're gonna go that far,
might
> as
> > well let the lisp routine handle the whole operation.
> >
> > Jon Crouch wrote in message
> > news:7uibj7$t5v19@adesknews2.autodesk.com...
> > > I have a lisp routine that uses entsel to ask the user for a
selection.
> > When
> > > I run the routine in a script, the script does not wait for the
> selection
> > > and the entsel recieves the next script command as its input, causing
> an
> > > error.
> > > Is there any way to have the script pause until the lisp routine is
> > > completed?
> > > Thanks again,
> > > Jon Crouch.
> > >
> > >
> >
> >
> >
0 Likes
Message 10 of 14

Anonymous
Not applicable
I beg to differ.

I've created interactive decision making scripts.

This is not impossible.

If he is trying to go from drawing to drawing.

--
Rudy@whainc.com
Programmer/Developer/MIS Assist.

Frank Oquendo wrote in article
<7uko02$6qh7@adesknews2.autodesk.com>...
> I did. SSGET "X" wasn't going to help him. He seems to be trying to do
the
> impossible: create an interactive or decision-making script. Neither is
> possible. The obvious solution is a LISP routine, not a script.
>
> Rudy Tovar wrote in message
> news:01bf1a8f$14b95900$1b09a8c0@mail.whainc.com...
> > Hello Frank.
> >
> > You should have followed the thread.
> >
> > --
> > Rudy@whainc.com
> > Programmer/Developer/MIS Assist.
> >
> > Frank Oquendo wrote in article
> > <7uir9i$1uv17@adesknews2.autodesk.com>...
> > > Scripts cannot be used interactively so your calls to entsel will
fail.
> > If
> > > you must use the routine in a script, you have to replace entsel with
> > > nentselp. Perhaps you can have the lisp routine build a selection set
> and
> > > then call the script to act on it. But if you're gonna go that far,
> might
> > as
> > > well let the lisp routine handle the whole operation.
> > >
> > > Jon Crouch wrote in message
> > > news:7uibj7$t5v19@adesknews2.autodesk.com...
> > > > I have a lisp routine that uses entsel to ask the user for a
> selection.
> > > When
> > > > I run the routine in a script, the script does not wait for the
> > selection
> > > > and the entsel recieves the next script command as its input,
causing
> > an
> > > > error.
> > > > Is there any way to have the script pause until the lisp routine is
> > > > completed?
> > > > Thanks again,
> > > > Jon Crouch.
> > > >
> > > >
> > >
> > >
> > >
>
>
>
0 Likes
Message 11 of 14

Anonymous
Not applicable
Since a script does not allow user input and has no decision constructs, I
am interested in hearing of your interactive scripts. Coupled with a LISP
routine, scripts can be quite powerful but in and of itself a script isn't
even as smart as a DOS batch file.

Rudy Tovar wrote in message
news:01bf1b23$46b2ee00$1b09a8c0@mail.whainc.com...
> I beg to differ.
>
> I've created interactive decision making scripts.
>
> This is not impossible.
>
> If he is trying to go from drawing to drawing.
>
> --
> Rudy@whainc.com
> Programmer/Developer/MIS Assist.
>
> Frank Oquendo wrote in article
> <7uko02$6qh7@adesknews2.autodesk.com>...
> > I did. SSGET "X" wasn't going to help him. He seems to be trying to do
> the
> > impossible: create an interactive or decision-making script. Neither is
> > possible. The obvious solution is a LISP routine, not a script.
> >
> > Rudy Tovar wrote in message
> > news:01bf1a8f$14b95900$1b09a8c0@mail.whainc.com...
> > > Hello Frank.
> > >
> > > You should have followed the thread.
> > >
> > > --
> > > Rudy@whainc.com
> > > Programmer/Developer/MIS Assist.
> > >
> > > Frank Oquendo wrote in article
> > > <7uir9i$1uv17@adesknews2.autodesk.com>...
> > > > Scripts cannot be used interactively so your calls to entsel will
> fail.
> > > If
> > > > you must use the routine in a script, you have to replace entsel
with
> > > > nentselp. Perhaps you can have the lisp routine build a selection
set
> > and
> > > > then call the script to act on it. But if you're gonna go that far,
> > might
> > > as
> > > > well let the lisp routine handle the whole operation.
> > > >
> > > > Jon Crouch wrote in message
> > > > news:7uibj7$t5v19@adesknews2.autodesk.com...
> > > > > I have a lisp routine that uses entsel to ask the user for a
> > selection.
> > > > When
> > > > > I run the routine in a script, the script does not wait for the
> > > selection
> > > > > and the entsel recieves the next script command as its input,
> causing
> > > an
> > > > > error.
> > > > > Is there any way to have the script pause until the lisp routine
is
> > > > > completed?
> > > > > Thanks again,
> > > > > Jon Crouch.
> > > > >
> > > > >
> > > >
> > > >
> > > >
> >
> >
> >
0 Likes
Message 12 of 14

Anonymous
Not applicable
The trick is to create a function that generates the script with the lisp
code that will be processed while the script is running.

Try it you'll like it.

As with lisp, most functions are process prior to activating the lisp. I've
created my own dialogs with cataloging properties that maintain sorting and
processing order, which gets generated into the script, which gets
activated after accepting all properties defined. This is so you can go
from drawing to drawing reprocessing a differing structure. This also
depends on what your end goal will be. Consider this: (1)processing
drawings (2)editing drawings (3)searching information, etc.

--
Rudy@whainc.com
Programmer/Developer/MIS Assist.
www.wharchitects.com

Frank Oquendo wrote in article
<7ul666$6qc31@adesknews2.autodesk.com>...
> Since a script does not allow user input and has no decision constructs,
I
> am interested in hearing of your interactive scripts. Coupled with a LISP
> routine, scripts can be quite powerful but in and of itself a script
isn't
> even as smart as a DOS batch file.
>
> Rudy Tovar wrote in message
> news:01bf1b23$46b2ee00$1b09a8c0@mail.whainc.com...
> > I beg to differ.
> >
> > I've created interactive decision making scripts.
> >
> > This is not impossible.
> >
> > If he is trying to go from drawing to drawing.
> >
> > --
> > Rudy@whainc.com
> > Programmer/Developer/MIS Assist.
> >
> > Frank Oquendo wrote in article
> > <7uko02$6qh7@adesknews2.autodesk.com>...
> > > I did. SSGET "X" wasn't going to help him. He seems to be trying to
do
> > the
> > > impossible: create an interactive or decision-making script. Neither
is
> > > possible. The obvious solution is a LISP routine, not a script.
> > >
> > > Rudy Tovar wrote in message
> > > news:01bf1a8f$14b95900$1b09a8c0@mail.whainc.com...
> > > > Hello Frank.
> > > >
> > > > You should have followed the thread.
> > > >
> > > > --
> > > > Rudy@whainc.com
> > > > Programmer/Developer/MIS Assist.
> > > >
> > > > Frank Oquendo wrote in article
> > > > <7uir9i$1uv17@adesknews2.autodesk.com>...
> > > > > Scripts cannot be used interactively so your calls to entsel will
> > fail.
> > > > If
> > > > > you must use the routine in a script, you have to replace entsel
> with
> > > > > nentselp. Perhaps you can have the lisp routine build a selection
> set
> > > and
> > > > > then call the script to act on it. But if you're gonna go that
far,
> > > might
> > > > as
> > > > > well let the lisp routine handle the whole operation.
> > > > >
> > > > > Jon Crouch wrote in message
> > > > > news:7uibj7$t5v19@adesknews2.autodesk.com...
> > > > > > I have a lisp routine that uses entsel to ask the user for a
> > > selection.
> > > > > When
> > > > > > I run the routine in a script, the script does not wait for the
> > > > selection
> > > > > > and the entsel recieves the next script command as its input,
> > causing
> > > > an
> > > > > > error.
> > > > > > Is there any way to have the script pause until the lisp
routine
> is
> > > > > > completed?
> > > > > > Thanks again,
> > > > > > Jon Crouch.
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
>
>
>
0 Likes
Message 13 of 14

Anonymous
Not applicable
oh god! rudy again.

you have to check in your routine if a script is active.
see the docs on (getvar "CMDACTIVE")
if so avoid entsel and supply a correct entity for the following code.
this way the user (and in the script case the next commands) are not
bothered.

or, better, supply a correct pick (list of entity and point) to your
script.

Rudy Tovar wrote:
>
> Hello Jon, I'm Rudy.
>
> Why not use 'nentselp' .
>
> Have your script search for the entity you wish to acquire, then extract
> the point of insertion or point of reference, then assign it to the
> nentselp. There by allowing it to rebuild the script and continuing.
>
> Jon Crouch wrote in article
> <7uibj7$t5v19@adesknews2.autodesk.com>...
> > I have a lisp routine that uses entsel to ask the user for a selection.
> When
> > I run the routine in a script, the script does not wait for the selection
> > and the entsel recieves the next script command as its input, causing an
> > error.
> > Is there any way to have the script pause until the lisp routine is
> > completed?
0 Likes
Message 14 of 14

Anonymous
Not applicable
Ok...Here's what I'm trying to do:
I have about 2000 dwgs and I want to create a database (probably an HTML
page) listing the dwg#, title, paper size, author etc. The drawings use
various title blocks that dont use text attributes, and there may be
additional text info i need to extract from the dwgs. I have written a lisp
routine that prompts me to click on the title, author etc. (using entsel),
then stores the texts in a list and writes them to HD ready for processing
and HTML conversion. However...at present I have to manually open each dwg
and then run the routine, so I wanted a script that would open the dwgs for
me and run the routine so that all I have to do is click the text items I
need.

Rudy Tovar wrote in message
news:01bf1a72$78ef3600$1b09a8c0@mail.whainc.com...
> Let me ask you something Jon.
>
> What's the application going to be used for?
>
>
>
> Jon Crouch wrote in article
> <7uiion$1tt2@adesknews2.autodesk.com>...
> > But I don't know what the text will say..
> >
> > Rudy Tovar wrote in message
> > news:01bf1a6b$c763e9e0$1b09a8c0@mail.whainc.com...
> > > If this is text then have the script search for the text and replace
or
> > > modify the given value you wish to change. You will not have to use
the
> > > entsel or entselp function if you use 'SSGET' "X".
> > >
> > >
> > >
> > > Jon Crouch wrote in article
> > > <7uihkp$t7b25@adesknews2.autodesk.com>...
> > > >
> > > > Rudy Tovar wrote in message
> > > > news:01bf1a62$0f74e720$1b09a8c0@mail.whainc.com...
> > > > > Hello Jon, I'm Rudy.
> > > > >
> > > > > Why not use 'nentselp' .
> > > > >
> > > > > Have your script search for the entity you wish to acquire, then
> > > extract
> > > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > > > I have no idea how to do this...the entity will be one of numerous
> text
> > > > items on the dwg and could be at any location.
> > > >
> > > > > the point of insertion or point of reference, then assign it to
the
> > > > > nentselp. There by allowing it to rebuild the script and
> continuing.
> > > > >
> > > > > --
> > > > > Rudy@whainc.com
> > > > > Programmer/Developer/MIS Assist.
> > > > >
> > > > >
> > > > > Jon Crouch wrote in article
> > > > > <7uibj7$t5v19@adesknews2.autodesk.com>...
> > > > > > I have a lisp routine that uses entsel to ask the user for a
> > > selection.
> > > > > When
> > > > > > I run the routine in a script, the script does not wait for the
> > > > selection
> > > > > > and the entsel recieves the next script command as its input,
> > causing
> > > an
> > > > > > error.
> > > > > > Is there any way to have the script pause until the lisp routine
> is
> > > > > > completed?
> > > > > > Thanks again,
> > > > > > Jon Crouch.
> > > > > >
> > > > > >
> > > > > >
> > > >
> > > >
> > > >
> >
> >
> >
0 Likes