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

entity name

12 REPLIES 12
Reply
Message 1 of 13
Anonymous
260 Views, 12 Replies

entity name

If I want to get the entity name of an object and use use it in a command.
How would this be done. And what kind of variable (is it a string?) is the
'entity name' and what would it look like?

Thanks
Edward
12 REPLIES 12
Message 2 of 13
Anonymous
in reply to: Anonymous

It depends on what command you want to use
the entity name with. The (entsel) function
returns a list containing an entity name,
and the coordinate used to select it using
a pick box. There are other ways to get one
or more entity names.

Can you rephrase your question in more specific terms?

"Edward Bagby" wrote in message
news:EFAB33A983A456E0DA95399070AA9411@in.WebX.maYIadrTaRb...
> If I want to get the entity name of an object and use use it in a command.
> How would this be done. And what kind of variable (is it a string?) is the
> 'entity name' and what would it look like?
>
> Thanks
> Edward
>
>
Message 3 of 13
Anonymous
in reply to: Anonymous

I don't know...
I'm ready to give up on this one. I'm trying to programatically explode a
leader and it's not working. Any thoughts on that?

Thank you very much,
Edward


"Tony Tanzillo" wrote in message
news:9E9DC60F7272A99C3DBD483C7FB24278@in.WebX.maYIadrTaRb...
> It depends on what command you want to use
> the entity name with. The (entsel) function
> returns a list containing an entity name,
> and the coordinate used to select it using
> a pick box. There are other ways to get one
> or more entity names.
>
> Can you rephrase your question in more specific terms?
>
> "Edward Bagby" wrote in message
> news:EFAB33A983A456E0DA95399070AA9411@in.WebX.maYIadrTaRb...
> > If I want to get the entity name of an object and use use it in a
command.
> > How would this be done. And what kind of variable (is it a string?) is
the
> > 'entity name' and what would it look like?
> >
> > Thanks
> > Edward
> >
> >
>
>
Message 4 of 13
Anonymous
in reply to: Anonymous

"Edward Bagby" wrote in message
news:376ABEEB160B8D2262FE8F74D002257C@in.WebX.maYIadrTaRb...
> I don't know...
> I'm ready to give up on this one. I'm trying to programatically explode a
> leader and it's not working. Any thoughts on that?

I can't really have much thoughts on what I've never
seen. Try posting your code, and then perhaps we can
make some progress.
Message 5 of 13
Anonymous
in reply to: Anonymous

(car (entsel))
prompts for a selection and returns an entity name.

But as Tony says, the method you use may vary depending on what it is you're
trying to accomplish.
___

"Edward Bagby" wrote in message
news:EFAB33A983A456E0DA95399070AA9411@in.WebX.maYIadrTaRb...
> If I want to get the entity name of an object and use use it in a command.
> How would this be done. And what kind of variable (is it a string?) is
the
> 'entity name' and what would it look like?
>
> Thanks
> Edward
>
>
Message 6 of 13
Anonymous
in reply to: Anonymous

Assumming you're having the user select the entity:

(setq ldr_to_exp (car (entsel)))
(command ".explode" ldr_to_exp)


"Edward Bagby" wrote in message
news:376ABEEB160B8D2262FE8F74D002257C@in.WebX.maYIadrTaRb...
> I don't know...
> I'm ready to give up on this one. I'm trying to programatically explode a
> leader and it's not working. Any thoughts on that?
>
> Thank you very much,
> Edward
>
>
> "Tony Tanzillo" wrote in message
> news:9E9DC60F7272A99C3DBD483C7FB24278@in.WebX.maYIadrTaRb...
> > It depends on what command you want to use
> > the entity name with. The (entsel) function
> > returns a list containing an entity name,
> > and the coordinate used to select it using
> > a pick box. There are other ways to get one
> > or more entity names.
> >
> > Can you rephrase your question in more specific terms?
> >
> > "Edward Bagby" wrote in message
> > news:EFAB33A983A456E0DA95399070AA9411@in.WebX.maYIadrTaRb...
> > > If I want to get the entity name of an object and use use it in a
> command.
> > > How would this be done. And what kind of variable (is it a string?)
is
> the
> > > 'entity name' and what would it look like?
> > >
> > > Thanks
> > > Edward
> > >
> > >
> >
> >
>
>
Message 7 of 13
Anonymous
in reply to: Anonymous

> How would this be done. And what kind of variable (is it a string?) is the
> 'entity name' and what would it look like?

1. The ename is not a string and can not be converted from a string.

2. The ename is a data type. You can get the ename from the handle
and vice versa.

3. Functions that can be used to obtain enames are:
entsel
nentsel
nentselp
entselp
ssname

4. Exploding objects (no need for ename)
(command "explode" pause "")

or
(and
(setq ss (ssget))
(command "explode" ss ""))

or

(and
(setq ename (car(entsel)))
(command "explode" ename ""))
Message 8 of 13
Anonymous
in reply to: Anonymous

Take a look at the lisp: xplode.lsp must be in the support folder of
autocad.

This is a portion of the code:


(setq e0 (entlast))
(setq en (entnext e0))
(while (not (null en)) ; find the last entity
(setq e0 en)
(setq en (entnext e0))
)

(command "_.EXPLODE" (xp_val -1 ent nil)) ; explode

(setq s0 (ssadd))

(while (entnext e0)
(ssadd (setq e0 (entnext e0))
s0
)
)

I think, that is what you are looking for.


"Edward Bagby" wrote in message
news:EFAB33A983A456E0DA95399070AA9411@in.WebX.maYIadrTaRb...
> If I want to get the entity name of an object and use use it in a command.
> How would this be done. And what kind of variable (is it a string?) is
the
> 'entity name' and what would it look like?
>
> Thanks
> Edward
>
>
Message 9 of 13
Anonymous
in reply to: Anonymous

Hi Doug,

Not to nit pick, but this doesn't work. It only explodes the first object in
the selection set.

> or
> (and
> (setq ss (ssget))
> (command "explode" ss ""))

You have to set the variable qaflags to 1, or step through the selection set
one at a time.

Joe Burke
Message 10 of 13
Anonymous
in reply to: Anonymous

here's the code for trying at the command line, though it doesn't work

(progn(ssget D)(setq i 0)(setq n_ent(sslength D))(repeat n_ent(command
"_explode" (ssname D i))(setq i (+ 1 i))))




"Edward Bagby" wrote in message
news:376ABEEB160B8D2262FE8F74D002257C@in.WebX.maYIadrTaRb...
> I don't know...
> I'm ready to give up on this one. I'm trying to programatically explode a
> leader and it's not working. Any thoughts on that?
>
> Thank you very much,
> Edward
>
>
> "Tony Tanzillo" wrote in message
> news:9E9DC60F7272A99C3DBD483C7FB24278@in.WebX.maYIadrTaRb...
> > It depends on what command you want to use
> > the entity name with. The (entsel) function
> > returns a list containing an entity name,
> > and the coordinate used to select it using
> > a pick box. There are other ways to get one
> > or more entity names.
> >
> > Can you rephrase your question in more specific terms?
> >
> > "Edward Bagby" wrote in message
> > news:EFAB33A983A456E0DA95399070AA9411@in.WebX.maYIadrTaRb...
> > > If I want to get the entity name of an object and use use it in a
> command.
> > > How would this be done. And what kind of variable (is it a string?)
is
> the
> > > 'entity name' and what would it look like?
> > >
> > > Thanks
> > > Edward
> > >
> > >
> >
> >
>
>
Message 11 of 13
Anonymous
in reply to: Anonymous

well, for starters... how about:

(setq D (ssget))

"Edward Bagby" wrote in message
news:EB88709BBDD841D7A207B8913F83BBAD@in.WebX.maYIadrTaRb...
> here's the code for trying at the command line, though it doesn't work
>
> (progn(ssget D)(setq i 0)(setq n_ent(sslength D))(repeat n_ent(command
> "_explode" (ssname D i))(setq i (+ 1 i))))
>
>
>
>
> "Edward Bagby" wrote in message
> news:376ABEEB160B8D2262FE8F74D002257C@in.WebX.maYIadrTaRb...
> > I don't know...
> > I'm ready to give up on this one. I'm trying to programatically explode
a
> > leader and it's not working. Any thoughts on that?
> >
> > Thank you very much,
> > Edward
> >
> >
> > "Tony Tanzillo" wrote in message
> > news:9E9DC60F7272A99C3DBD483C7FB24278@in.WebX.maYIadrTaRb...
> > > It depends on what command you want to use
> > > the entity name with. The (entsel) function
> > > returns a list containing an entity name,
> > > and the coordinate used to select it using
> > > a pick box. There are other ways to get one
> > > or more entity names.
> > >
> > > Can you rephrase your question in more specific terms?
> > >
> > > "Edward Bagby" wrote in message
> > > news:EFAB33A983A456E0DA95399070AA9411@in.WebX.maYIadrTaRb...
> > > > If I want to get the entity name of an object and use use it in a
> > command.
> > > > How would this be done. And what kind of variable (is it a string?)
> is
> > the
> > > > 'entity name' and what would it look like?
> > > >
> > > > Thanks
> > > > Edward
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Message 12 of 13
Anonymous
in reply to: Anonymous

Also, with this 'simple' routine, there isn't any error checking, so if you
pick entities that can't be exploded (i.e. TEXT), then it's going to stop.

"Edward Bagby" wrote in message
news:EB88709BBDD841D7A207B8913F83BBAD@in.WebX.maYIadrTaRb...
> here's the code for trying at the command line, though it doesn't work
>
> (progn(ssget D)(setq i 0)(setq n_ent(sslength D))(repeat n_ent(command
> "_explode" (ssname D i))(setq i (+ 1 i))))
>
>
>
>
> "Edward Bagby" wrote in message
> news:376ABEEB160B8D2262FE8F74D002257C@in.WebX.maYIadrTaRb...
> > I don't know...
> > I'm ready to give up on this one. I'm trying to programatically explode
a
> > leader and it's not working. Any thoughts on that?
> >
> > Thank you very much,
> > Edward
> >
> >
> > "Tony Tanzillo" wrote in message
> > news:9E9DC60F7272A99C3DBD483C7FB24278@in.WebX.maYIadrTaRb...
> > > It depends on what command you want to use
> > > the entity name with. The (entsel) function
> > > returns a list containing an entity name,
> > > and the coordinate used to select it using
> > > a pick box. There are other ways to get one
> > > or more entity names.
> > >
> > > Can you rephrase your question in more specific terms?
> > >
> > > "Edward Bagby" wrote in message
> > > news:EFAB33A983A456E0DA95399070AA9411@in.WebX.maYIadrTaRb...
> > > > If I want to get the entity name of an object and use use it in a
> > command.
> > > > How would this be done. And what kind of variable (is it a string?)
> is
> > the
> > > > 'entity name' and what would it look like?
> > > >
> > > > Thanks
> > > > Edward
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Message 13 of 13
Anonymous
in reply to: Anonymous

As you can see I'm a little rusty (been doing nothing but VB for the last 6
mo's)
Anyway, thanks for the comments, they got me through this. VB and Lisp are
extremely different so it takes a day or two...

Edward


"Jason Wilder" wrote in message
news:2E5C5296844EC6CA745FE77ED534511A@in.WebX.maYIadrTaRb...
> well, for starters... how about:
>
> (setq D (ssget))
>
> "Edward Bagby" wrote in message
> news:EB88709BBDD841D7A207B8913F83BBAD@in.WebX.maYIadrTaRb...
> > here's the code for trying at the command line, though it doesn't work
> >
> > (progn(ssget D)(setq i 0)(setq n_ent(sslength D))(repeat n_ent(command
> > "_explode" (ssname D i))(setq i (+ 1 i))))
> >
> >
> >
> >
> > "Edward Bagby" wrote in message
> > news:376ABEEB160B8D2262FE8F74D002257C@in.WebX.maYIadrTaRb...
> > > I don't know...
> > > I'm ready to give up on this one. I'm trying to programatically
explode
> a
> > > leader and it's not working. Any thoughts on that?
> > >
> > > Thank you very much,
> > > Edward
> > >
> > >
> > > "Tony Tanzillo" wrote in message
> > > news:9E9DC60F7272A99C3DBD483C7FB24278@in.WebX.maYIadrTaRb...
> > > > It depends on what command you want to use
> > > > the entity name with. The (entsel) function
> > > > returns a list containing an entity name,
> > > > and the coordinate used to select it using
> > > > a pick box. There are other ways to get one
> > > > or more entity names.
> > > >
> > > > Can you rephrase your question in more specific terms?
> > > >
> > > > "Edward Bagby" wrote in message
> > > > news:EFAB33A983A456E0DA95399070AA9411@in.WebX.maYIadrTaRb...
> > > > > If I want to get the entity name of an object and use use it in a
> > > command.
> > > > > How would this be done. And what kind of variable (is it a
string?)
> > is
> > > the
> > > > > 'entity name' and what would it look like?
> > > > >
> > > > > Thanks
> > > > > Edward
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>

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

Post to forums  

Autodesk Design & Make Report

”Boost