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

ssname resulting in nil

15 REPLIES 15
Reply
Message 1 of 16
Anonymous
398 Views, 15 Replies

ssname resulting in nil

Hi,

I have a selectionset wich consists of 22 entity's.
But when I do (ssname ss1 1) it results in nil

How can this be? Shouldn't this always result in an entitylist?

Can anyone enlighten me?

M
15 REPLIES 15
Message 2 of 16
Anonymous
in reply to: Anonymous

I ment to say:

(entget (ssname ss1 1)) results in nil

(ssname ss1 0)
(ssname ss1 1)
(ssname ss1 2)
And so on.

Result in an entityname.



"M. Janmaat" schreef in bericht
news:6095921@discussion.autodesk.com...
Hi,

I have a selectionset wich consists of 22 entity's.
But when I do (ssname ss1 1) it results in nil

How can this be? Shouldn't this always result in an entitylist?

Can anyone enlighten me?

M
Message 3 of 16
H.vanZeeland
in reply to: Anonymous

Hi,



what are the result of



(vlax-erased-p (vlax-ename->vla-object (ssname ss1 1)))



if the result is T then the object is erased.



or maybe a audit will help



Cheers

Harrie
Message 4 of 16
Anonymous
in reply to: Anonymous


(vlax-ename->vla-object (ssname ss1
1))

 

results in nil

 

Here the results of 0 and 2;

 

_1_$ (vlax-ename->vla-object (ssname ss1
0))
#<VLA-OBJECT IAcadBlockReference 0afe74e4>
_1_$
(vlax-ename->vla-object (ssname ss1 2))
#<VLA-OBJECT
IAcadBlockReference 0afe7474>
_1_$

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Hi,



what
are the result of



(vlax-erased-p (vlax-ename->vla-object
(ssname ss1 1)))



if the result is T then the object is
erased.



or maybe a audit will
help



Cheers

Harrie
Message 5 of 16
H.vanZeeland
in reply to: Anonymous

Hi,



Very strange,



The result of (vlax-ename->vla-object (ssname ss1 1)) gives also a vla-object?



And the result of (vlax-dump-object (vlax-ename->vla-object (ssname ss1 1)))



Harrie
Message 6 of 16
Anonymous
in reply to: Anonymous


Harrie,

 

(ssname ss1 1) results in <Entity name:
7e9e2ab0>

 

(vlax-ename->vla-object (ssname ss1 1))

(vlax-dump-object (vlax-ename->vla-object (ssname ss1 1)))

 

Both result in nil.

 

I don't get it either. Wich explains my
post.

 

I've created a workaround for it.

 

Thanks for the replies.

 

M.vr.gr. (assuming your Dutch)

 

M

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Hi,



Very
strange,



The result of (vlax-ename->vla-object (ssname ss1
1)) gives also a vla-object?



And the result of
(vlax-dump-object (vlax-ename->vla-object (ssname ss1
1)))



Harrie
Message 7 of 16
Anonymous
in reply to: Anonymous

Can you post a drawing with the entity that fails
with (entget) ?

That should only happen if the entity is erased.

--

http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009
http://www.acadxtabs.com

Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm


"M. Janmaat" wrote in message news:6095931@discussion.autodesk.com...
Harrie,

(ssname ss1 1) results in

(vlax-ename->vla-object (ssname ss1 1))
(vlax-dump-object (vlax-ename->vla-object (ssname ss1 1)))

Both result in nil.

I don't get it either. Wich explains my post.

I've created a workaround for it.

Thanks for the replies.

M.vr.gr. (assuming your Dutch)

M


schreef in bericht news:6095928@discussion.autodesk.com...
Hi,



Very strange,



The result of (vlax-ename->vla-object (ssname ss1 1)) gives also a vla-object?



And the result of (vlax-dump-object (vlax-ename->vla-object (ssname ss1 1)))



Harrie
Message 8 of 16
Anonymous
in reply to: Anonymous

helo

dont try it that way, if I may, try this.. I dont know further explanation but this works..

1. replace entsel with ssget in your routine..

2. if you want to use entsel,
(setq blah (vlax-ename->vla-object (car (entsel))))

but i prefer the first one.. much simpler
Message 9 of 16
Anonymous
in reply to: Anonymous

I threw the drawing away.

Here a new one. this one also goes wrong. Now with the first entity in ss1.
I do get the ename. Not the elist.

But I've "solved" my problem. Well... solved. I don't need a solution
anymore. I've created a woraround.
I prefer to follow the path of least resistance. You know, like the
"collapse" of WTC1, 2 and 7 on 9/11 : ) : )

M


"Tony Tanzillo" schreef in bericht
news:6095998@discussion.autodesk.com...
Can you post a drawing with the entity that fails
with (entget) ?

That should only happen if the entity is erased.

--

http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009
http://www.acadxtabs.com

Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm


"M. Janmaat" wrote in message
news:6095931@discussion.autodesk.com...
Harrie,

(ssname ss1 1) results in

(vlax-ename->vla-object (ssname ss1 1))
(vlax-dump-object (vlax-ename->vla-object (ssname ss1 1)))

Both result in nil.

I don't get it either. Wich explains my post.

I've created a workaround for it.

Thanks for the replies.

M.vr.gr. (assuming your Dutch)

M


schreef in bericht news:6095928@discussion.autodesk.com...
Hi,



Very strange,



The result of (vlax-ename->vla-object (ssname ss1 1)) gives also a
vla-object?



And the result of (vlax-dump-object (vlax-ename->vla-object (ssname ss1
1)))



Harrie
Message 10 of 16
Anonymous
in reply to: Anonymous


Need to use ssget.

 

Thanks.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
helo
dont try it that way, if I may, try this.. I dont know further explanation but
this works.. 1. replace entsel with ssget in your routine.. 2. if you want to
use entsel, (setq blah (vlax-ename->vla-object (car (entsel)))) but i
prefer the first one.. much simpler
Message 11 of 16
Anonymous
in reply to: Anonymous

Just a guess...

What may be happening is the selection set is being modified, example calling ssdel,
within a loop function like repeat or while.

That could cause the error you reported.

Joe Burke


"M. Janmaat" wrote in message
news:6095921@discussion.autodesk.com...
Hi,

I have a selectionset wich consists of 22 entity's.
But when I do (ssname ss1 1) it results in nil

How can this be? Shouldn't this always result in an entitylist?

Can anyone enlighten me?

M
Message 12 of 16
Anonymous
in reply to: Anonymous

You're right!

This was the problem;
Somwhere along the way I exploded a block wich caused this to happen.
When I explode a block I would also have to remove it's entityname from the
selectionset.

Thanks!

"Joe Burke" schreef in bericht
news:6096463@discussion.autodesk.com...
Just a guess...

What may be happening is the selection set is being modified, example
calling ssdel,
within a loop function like repeat or while.

That could cause the error you reported.

Joe Burke


"M. Janmaat" wrote in message
news:6095921@discussion.autodesk.com...
Hi,

I have a selectionset wich consists of 22 entity's.
But when I do (ssname ss1 1) it results in nil

How can this be? Shouldn't this always result in an entitylist?

Can anyone enlighten me?

M
Message 13 of 16
Anonymous
in reply to: Anonymous

You're welcome.
Message 14 of 16
Anonymous
in reply to: Anonymous

You'll have to do better to help isolate the problem(if you still want a
solution). Provide actual code, not vague snippets. Identify which objects
to select.

Post code complete enough to test and with instructions how to test. Its
more likely a coding problem on your part than an error in either lisp or a
drawing.

On my tests, nothing went wrong.

Example: (setq ss (ssget))
(entget (ssname ss 0)) returns good entity data. Same goes for any number up
to sslength-1.




"M. Janmaat" wrote in message
news:6096442@discussion.autodesk.com...
I threw the drawing away.

Here a new one. this one also goes wrong. Now with the first entity in ss1.
I do get the ename. Not the elist.

But I've "solved" my problem. Well... solved. I don't need a solution
anymore. I've created a woraround.
I prefer to follow the path of least resistance. You know, like the
"collapse" of WTC1, 2 and 7 on 9/11 : ) : )

M


"Tony Tanzillo" schreef in bericht
news:6095998@discussion.autodesk.com...
Can you post a drawing with the entity that fails
with (entget) ?

That should only happen if the entity is erased.

--

http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009
http://www.acadxtabs.com

Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm


"M. Janmaat" wrote in message
news:6095931@discussion.autodesk.com...
Harrie,

(ssname ss1 1) results in

(vlax-ename->vla-object (ssname ss1 1))
(vlax-dump-object (vlax-ename->vla-object (ssname ss1 1)))

Both result in nil.

I don't get it either. Wich explains my post.

I've created a workaround for it.

Thanks for the replies.

M.vr.gr. (assuming your Dutch)

M


schreef in bericht news:6095928@discussion.autodesk.com...
Hi,



Very strange,



The result of (vlax-ename->vla-object (ssname ss1 1)) gives also a
vla-object?



And the result of (vlax-dump-object (vlax-ename->vla-object (ssname ss1
1)))



Harrie
Message 15 of 16
Anonymous
in reply to: Anonymous

It was a coding problem on my part.
Sorry for the inconvenience.
In some other linked code I exploded a block after the selectioset.

"Doug Broad" schreef in bericht
news:6096523@discussion.autodesk.com...
You'll have to do better to help isolate the problem(if you still want a
solution). Provide actual code, not vague snippets. Identify which objects
to select.

Post code complete enough to test and with instructions how to test. Its
more likely a coding problem on your part than an error in either lisp or a
drawing.

On my tests, nothing went wrong.

Example: (setq ss (ssget))
(entget (ssname ss 0)) returns good entity data. Same goes for any number up
to sslength-1.




"M. Janmaat" wrote in message
news:6096442@discussion.autodesk.com...
I threw the drawing away.

Here a new one. this one also goes wrong. Now with the first entity in ss1.
I do get the ename. Not the elist.

But I've "solved" my problem. Well... solved. I don't need a solution
anymore. I've created a woraround.
I prefer to follow the path of least resistance. You know, like the
"collapse" of WTC1, 2 and 7 on 9/11 : ) : )

M


"Tony Tanzillo" schreef in bericht
news:6095998@discussion.autodesk.com...
Can you post a drawing with the entity that fails
with (entget) ?

That should only happen if the entity is erased.

--

http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009
http://www.acadxtabs.com

Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm


"M. Janmaat" wrote in message
news:6095931@discussion.autodesk.com...
Harrie,

(ssname ss1 1) results in

(vlax-ename->vla-object (ssname ss1 1))
(vlax-dump-object (vlax-ename->vla-object (ssname ss1 1)))

Both result in nil.

I don't get it either. Wich explains my post.

I've created a workaround for it.

Thanks for the replies.

M.vr.gr. (assuming your Dutch)

M


schreef in bericht news:6095928@discussion.autodesk.com...
Hi,



Very strange,



The result of (vlax-ename->vla-object (ssname ss1 1)) gives also a
vla-object?



And the result of (vlax-dump-object (vlax-ename->vla-object (ssname ss1
1)))



Harrie
Message 16 of 16
Anonymous
in reply to: Anonymous

Glad you found it.

"M. Janmaat" wrote in message
news:6096533@discussion.autodesk.com...
It was a coding problem on my part.
Sorry for the inconvenience.
In some other linked code I exploded a block after the selectioset.

"Doug Broad" schreef in bericht
news:6096523@discussion.autodesk.com...
You'll have to do better to help isolate the problem(if you still want a
solution). Provide actual code, not vague snippets. Identify which objects
to select.

Post code complete enough to test and with instructions how to test. Its
more likely a coding problem on your part than an error in either lisp or a
drawing.

On my tests, nothing went wrong.

Example: (setq ss (ssget))
(entget (ssname ss 0)) returns good entity data. Same goes for any number up
to sslength-1.




"M. Janmaat" wrote in message
news:6096442@discussion.autodesk.com...
I threw the drawing away.

Here a new one. this one also goes wrong. Now with the first entity in ss1.
I do get the ename. Not the elist.

But I've "solved" my problem. Well... solved. I don't need a solution
anymore. I've created a woraround.
I prefer to follow the path of least resistance. You know, like the
"collapse" of WTC1, 2 and 7 on 9/11 : ) : )

M


"Tony Tanzillo" schreef in bericht
news:6095998@discussion.autodesk.com...
Can you post a drawing with the entity that fails
with (entget) ?

That should only happen if the entity is erased.

--

http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009
http://www.acadxtabs.com

Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm


"M. Janmaat" wrote in message
news:6095931@discussion.autodesk.com...
Harrie,

(ssname ss1 1) results in

(vlax-ename->vla-object (ssname ss1 1))
(vlax-dump-object (vlax-ename->vla-object (ssname ss1 1)))

Both result in nil.

I don't get it either. Wich explains my post.

I've created a workaround for it.

Thanks for the replies.

M.vr.gr. (assuming your Dutch)

M


schreef in bericht news:6095928@discussion.autodesk.com...
Hi,



Very strange,



The result of (vlax-ename->vla-object (ssname ss1 1)) gives also a
vla-object?



And the result of (vlax-dump-object (vlax-ename->vla-object (ssname ss1
1)))



Harrie

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

Post to forums  

Autodesk Design & Make Report

”Boost