My AutoLISP is a bit rusty so I apologize if this has an easy answer.
I'm trying to write a routine that lets the user select block A and then inserts block B (a tag) using block A's name and the (only) attribute. I've managed to extract the first block's name using:
(setq ent (nentsel))
(setq blk-name (vla-get-EffectiveName (vlax-ename->vla-object (last (last ent)))))
But when I try to insert the block, I can't get block A's name (as returned by blk-name) as the attribute text using
(Command -insert _tag-part 0,0,0 48 48 0 blk-name)
it fails. I think the attribute parameter (blk-name) is causing the problem because it's not in the form of a string. Any suggestions to get this to work?
Thanks,
Jon
Solved! Go to Solution.
Solved by _Tharwat. Go to Solution.
For your first code to get the real name of the selected block ..
Try ...
(setq ent (nentsel))
(setq blk-name (vla-get-EffectiveName (vlax-ename->vla-object (car ent))))
Thanks, but when I use
(setq ent (nentsel))
(setq blk-name (vla-get-EffectiveName (vlax-ename->vla-object (car ent))))
and pick the block "breakline it returns "Select object: ; error: ActiveX Server returned the error: unknown name:
EffectiveName"
When I use
(setq ent (nentsel))
(setq blk-name (vla-get-EffectiveName (vlax-ename->vla-object (last (last ent)))))
it returns""breakline"". Is there something going on that I'm not seeing?
Thanks
Jon
You should add the following code to your file and load it to activate the Active x codes .
(vl-load-com)
I have just noticed that you are using the function *nentsel* which enter a definition and it is not the proper function for you needs , so just use function *entsel* instead of *nentsel*
Thanks
Thanks, that helped a lot. My code needs to be fleshed out but this helped.
Thanks again,
Jpn