.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

****!!!REALLY SIMPLE C#/AUTOCAD QUESTION!!!*** Manipulate a drawing

5 REPLIES 5
Reply
Message 1 of 6
lbayas
340 Views, 5 Replies

****!!!REALLY SIMPLE C#/AUTOCAD QUESTION!!!*** Manipulate a drawing

Hi-

I am writing a really simple C# application. It basically takes values and puts them into an autocad drawing. Right now I am able to to open an AutoCAD drawing but I am having trouble manipulating it the way I would like. The following code below is what I have so far:

gbl_app = new AcadApplication();
gbl_doc = gbl_app.ActiveDocument;
gbl_doc.Open(AcadFile, password);
gbl_app.Application.Visible = true;

My next step is to grab all the text objects in gbl_doc and change them, does anyone know what my next step should be? Should I be using a "Selection Set" for this? Thanks a bunch
5 REPLIES 5
Message 2 of 6
Anonymous
in reply to: lbayas

Your next step should be going to buy a textbook from Deitel & Deitel and
learn how to use C#. I would also recommend that you use the web to find and
adopt Microsoft's C# naming conventions. Drop your bad habits now. Once you
learn how to use C# you should then start learning the .NET Framework noting
most of the important documentation is at msdn2.microsoft.com which has been
dysfunctional for a couple of months now but you can still find lots of
documentation for C# at msdn.microsoft.com.

Meanwhile, what you want to do is set up a foreach loop passing gbl_doc as
the parameter. Inside the loop you use the GetType( ) method to test for the
type of object you are looking for. When you find the type of object you
want you can do something with it.

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
MAP http://wikimapia.org/#y=43038073&x=-88043838&z=17&l=0&m=h


wrote in message news:5429174@discussion.autodesk.com...
Hi-

I am writing a really simple C# application. It basically takes values and
puts them into an autocad drawing. Right now I am able to to open an AutoCAD
drawing but I am having trouble manipulating it the way I would like. The
following code below is what I have so far:

gbl_app = new AcadApplication();
gbl_doc = gbl_app.ActiveDocument;
gbl_doc.Open(AcadFile, password);
gbl_app.Application.Visible = true;

My next step is to grab all the text objects in gbl_doc and change them,
does anyone know what my next step should be? Should I be using a "Selection
Set" for this? Thanks a bunch
Message 3 of 6
Anonymous
in reply to: lbayas

"clintonG" wrote:

>> Meanwhile, what you want to do is set up a
>> foreach loop passing gbl_doc as the parameter.
>> Inside the loop you use the GetType( ) method
>> to test for the type of object you are looking for.
>> When you find the type of object you want you
>> can do something with it.

Perhaps you should refrain from advising others
on how to go about doing things, that you quite
obviously, don't know how to do yourself.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com
Message 4 of 6
Anonymous
in reply to: lbayas

It it depends on where the text objects you want
to process are located. If they're in model space
or a paper space layout, you can use a selection
set to collect them, and then process the selection
set.

--
http://www.caddzone.com

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

wrote in message news:5429174@discussion.autodesk.com...
Hi-

I am writing a really simple C# application. It basically takes values and puts them into an autocad drawing. Right now I am able to to open an AutoCAD drawing but I am having trouble manipulating it the way I would like. The following code below is what I have so far:

gbl_app = new AcadApplication();
gbl_doc = gbl_app.ActiveDocument;
gbl_doc.Open(AcadFile, password);
gbl_app.Application.Visible = true;

My next step is to grab all the text objects in gbl_doc and change them, does anyone know what my next step should be? Should I be using a "Selection Set" for this? Thanks a bunch
Message 5 of 6
lbayas
in reply to: lbayas

First off -- Mr. Clinton Gallagher, I am well-versed in C#, more so than you are with those cheap looking websites you make for a living. Why don't you try to answer the question instead of criticizing others on convention.

Now back to business. Thanks Tony for actually answering my AutoCAD related question. So I will have to use selection sets to obtain the text from my layout. I believe I am in "paper space layout" with a 2-D drawing.
Message 6 of 6
Anonymous
in reply to: lbayas

dang, you are swimming with the sharks now!

lbayas <>
|>First off -- Mr. Clinton Gallagher, I am well-versed in C#, more so than you are with those cheap looking websites you make for a living. Why don't you try to answer the question instead of criticizing others on convention.
|>
|>Now back to business. Thanks Tony for actually answering my AutoCAD related question. So I will have to use selection sets to obtain the text from my layout. I believe I am in "paper space layout" with a 2-D drawing.
James Maeding
Civil Engineer and Programmer
jmaeding - athunsaker - com

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost