.NET

.NET

Reply
Active Contributor
lbayas
Posts: 26
Registered: ‎12-06-2006
Message 1 of 6 (137 Views)

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

137 Views, 5 Replies
12-18-2006 10:54 AM
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
*clintonG
Message 2 of 6 (137 Views)

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

12-19-2006 01:55 PM 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
*Tony Tanzillo
Message 3 of 6 (137 Views)

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

12-19-2006 02:38 PM 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
*Tony Tanzillo
Message 4 of 6 (137 Views)

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

12-19-2006 02:38 PM 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
Active Contributor
lbayas
Posts: 26
Registered: ‎12-06-2006
Message 5 of 6 (137 Views)

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

12-20-2006 07:51 AM 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.
*James Maeding
Message 6 of 6 (137 Views)

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

12-20-2006 02:12 PM 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
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.