Block has two different assoc 2 names

Block has two different assoc 2 names

tcorey
Mentor Mentor
659 Views
4 Replies
Message 1 of 5

Block has two different assoc 2 names

tcorey
Mentor
Mentor

I don't get it.

 

I have a block, the name is "P-Slope Arrow" but this is only sometimes the answer I get back when I (cdr (assoc 2 theblock)). I can take two blocks, look at the properties window in AutoCAD. Both will be P-Slope Arrow. If I (cdr (assoc 2....)) both of them, one might come back "P-Slope Arrow" and the other might come back "*U525" or some other *U###.

 

Can someone enlighten me as to what is going on and how to drill down to the common name when AutoCAD returns *U###?

 

Thanks,

 

Tim



Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut
0 Likes
Accepted solutions (2)
660 Views
4 Replies
Replies (4)
Message 2 of 5

hmsilva
Mentor
Mentor
Accepted solution

@tcorey wrote:

I don't get it.

 

I have a block, the name is "P-Slope Arrow" but this is only sometimes the answer I get back when I (cdr (assoc 2 theblock)). I can take two blocks, look at the properties window in AutoCAD. Both will be P-Slope Arrow. If I (cdr (assoc 2....)) both of them, one might come back "P-Slope Arrow" and the other might come back "*U525" or some other *U###.

 

Can someone enlighten me as to what is going on and how to drill down to the common name when AutoCAD returns *U###?

 

Thanks,

 

Tim


Hi Tim,

Dynamic block???

 

Try to get the 'effectivename property as a vla object...

 

Hope this helps,
Henrique

 

EESignature

Message 3 of 5

Kent1Cooper
Consultant
Consultant
Accepted solution

An altered extract from another routine of mine that gets the effective name from a dynamic Block, but the ordinary name from an ordinary Block, and puts it into the 'name' variable:

 

        (setq
          bobj (vlax-ename->vla-object (car (entsel "\nSelect Block: ")))
          name
            (if (vlax-property-available-p bobj 'effectivename)
              (vla-get-EffectiveName bobj)
              (vla-get-Name bobj)
            ); if & old
        ); setq

 

Kent Cooper, AIA
Message 4 of 5

tcorey
Mentor
Mentor

Thank you, gentlemen. That solves my issue.

 

Best wishes to you both,

 

Tim



Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut
0 Likes
Message 5 of 5

hmsilva
Mentor
Mentor

You're welcome, Tim
Glad I could help

Henrique

EESignature

0 Likes