.NET

Reply
*Tony Tanzillo
Message 11 of 14 (61 Views)

Re: parameter ename for an extern command

12-07-2006 08:28 AM in reply to: base2
As far as passing the entity as a param, you
don't need it. You only need its object id, and
for that you don't even need to open it, as
the object id is needed to do that.

To say what you're doing is a little dangerous
is an understatement. You need to learn more
about the API, and specifically the perils of
leaving objects open longer than you need to.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

wrote in message news:5417816@discussion.autodesk.com...
I understood...
You said that a row as:

Entity ent = (Entity)trans.GetObject(ids[0], OpenMode.ForRead, false);

followed by
-->acedcmd( bla bla ... invoke extern command, ent )
--> ent.close();
-->restoredialog..


it's a little dangerous...
maybe...but it's the only way that i know to use the entity as parameter. is there another way...?
Valued Contributor
base2
Posts: 80
Registered: ‎04-20-2005
Message 12 of 14 (61 Views)

Re: parameter ename for an extern command

12-07-2006 09:03 AM in reply to: base2
sorry, it's a little hard to me understand the real problem...

ResultBuffer args = new ResultBuffer();
args = new ResultBuffer();
args.Add(new TypedValue(RTSTR, "EXTERCOMMAND"));
args.Add(new TypedValue(RTENAME, ent.Id));
args.Add(new TypedValue(RTSTR, ""));
args.Add(new TypedValue(RTSTR, "c:\\temp\\gege.CCC"));

Command(args); // THIS Perform acedcmd..

You said that I can substitute this
args.Add(new TypedValue(RTENAME, ent.Id));
with a similiar expression...
args.Add(new TypedValue(RTENAME, Ids[0]));
without entity opened.... where ids[0] it's the id selected by user...
*Tony Tanzillo
Message 13 of 14 (61 Views)

Re: parameter ename for an extern command

12-07-2006 10:18 AM in reply to: base2
sorry I do not follow you.

The ObjectId that you pass to GetObject() is the
same as the ObjectId that's returned by the resulting
object's Id property.

So, if the only reason you are opening the object
is to get its object id, then there is no point to it,
because you already have the object id.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

wrote in message news:5418111@discussion.autodesk.com...
sorry, it's a little hard to me understand the real problem...

ResultBuffer args = new ResultBuffer();
args = new ResultBuffer();
args.Add(new TypedValue(RTSTR, "EXTERCOMMAND"));
args.Add(new TypedValue(RTENAME, ent.Id));
args.Add(new TypedValue(RTSTR, ""));
args.Add(new TypedValue(RTSTR, "c:\\temp\\gege.CCC"));

Command(args); // THIS Perform acedcmd..

You said that I can substitute this
args.Add(new TypedValue(RTENAME, ent.Id));
with a similiar expression...
args.Add(new TypedValue(RTENAME, Ids[0]));
without entity opened.... where ids[0] it's the id selected by user...
Valued Contributor
base2
Posts: 80
Registered: ‎04-20-2005
Message 14 of 14 (61 Views)

Re: parameter ename for an extern command

12-08-2006 01:10 AM in reply to: base2
of course! i'm very blind! :smileysad:
thank You very much !!!
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!