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

How to Write it In C#

12 REPLIES 12
Reply
Message 1 of 13
bigbignext
868 Views, 12 Replies

How to Write it In C#

VBA code:
Dim plineObj As AcadLWPolyline
````````````
' Explode the polyline
Dim explodedObjects As Variant
explodedObjects = plineObj.Explode

I want to use C# to write it ,please help me thinks you
12 REPLIES 12
Message 2 of 13
Anonymous
in reply to: bigbignext

Why not just go to any of the sites on the net
that convert code between C# and VB.NET ?

Or, get a copy of Reflector, and you can view
the compiled code in any of the languages it
supports.

--
http://www.caddzone.com

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

wrote in message news:5519449@discussion.autodesk.com...
VBA code:
Dim plineObj As AcadLWPolyline
````````````
' Explode the polyline
Dim explodedObjects As Variant
explodedObjects = plineObj.Explode

I want to use C# to write it ,please help me thinks you
Message 3 of 13
Anonymous
in reply to: bigbignext

Could it be because the O.P. wants to know how to convert -- VBA -- to C#?
If there's a VBA to C# converter around I would sure like to know about it.
There is no such thing as a Variant data type in VB.NET so pasting the code
into a VB.NET to C# converter will faill anyway.

For the OP though it might help to explain C# does away with the excess
verbiage such as Dim when initializing. Other verbiage too. The first
statement would be writen as follows... very easy to convert on the fly.

// Object Type Object Name End of statementdelineator
AcadLWPolyline plineObj ;

But as noted, the explodedObjects was initialized in VBA as a Variant data
type which I do not think .NET supports. Using Google to
search msdn2.microsoft.com is where I would go next but if I intended to
learn C# I would go to Deitel & Deitel [1] and get the title of a couple of
their C# "Learn to Program" textbooks. I'd have my local Barnes & Noble
order them all for in-store review and I would buy the one I thought would
help me to learn C#.

--
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/

[1] http://deitel.com/




"Tony Tanzillo" wrote in message
news:5519512@discussion.autodesk.com...
Why not just go to any of the sites on the net
that convert code between C# and VB.NET ?

Or, get a copy of Reflector, and you can view
the compiled code in any of the languages it
supports.

--
http://www.caddzone.com

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

wrote in message news:5519449@discussion.autodesk.com...
VBA code:
Dim plineObj As AcadLWPolyline
````````````
' Explode the polyline
Dim explodedObjects As Variant
explodedObjects = plineObj.Explode

I want to use C# to write it ,please help me thinks you
Message 4 of 13
Anonymous
in reply to: bigbignext

Oops.. I thought he meant VB.NET to C#, not VBA to C#.

--
http://www.caddzone.com

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

"clintonG" wrote in message news:5519698@discussion.autodesk.com...
Could it be because the O.P. wants to know how to convert -- VBA -- to C#?
If there's a VBA to C# converter around I would sure like to know about it.
There is no such thing as a Variant data type in VB.NET so pasting the code
into a VB.NET to C# converter will faill anyway.

For the OP though it might help to explain C# does away with the excess
verbiage such as Dim when initializing. Other verbiage too. The first
statement would be writen as follows... very easy to convert on the fly.

// Object Type Object Name End of statementdelineator
AcadLWPolyline plineObj ;

But as noted, the explodedObjects was initialized in VBA as a Variant data
type which I do not think .NET supports. Using Google to
search msdn2.microsoft.com is where I would go next but if I intended to
learn C# I would go to Deitel & Deitel [1] and get the title of a couple of
their C# "Learn to Program" textbooks. I'd have my local Barnes & Noble
order them all for in-store review and I would buy the one I thought would
help me to learn C#.

--
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/

[1] http://deitel.com/




"Tony Tanzillo" wrote in message
news:5519512@discussion.autodesk.com...
Why not just go to any of the sites on the net
that convert code between C# and VB.NET ?

Or, get a copy of Reflector, and you can view
the compiled code in any of the languages it
supports.

--
http://www.caddzone.com

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

wrote in message news:5519449@discussion.autodesk.com...
VBA code:
Dim plineObj As AcadLWPolyline
````````````
' Explode the polyline
Dim explodedObjects As Variant
explodedObjects = plineObj.Explode

I want to use C# to write it ,please help me thinks you
Message 5 of 13
Anonymous
in reply to: bigbignext

AcadWLPolyline plineObj=.....;
Object explodedObjects=plineObj.Explode();

Since the returned object is an array of AcadObject, you can then cast it
this way

AcadObject[] objs = (AcadEntity[]) explodedObjects;

Or make code even simple

AcadObject[] objs=plineObj.Explode() As AcadObject[];


wrote in message news:5519449@discussion.autodesk.com...
VBA code:
Dim plineObj As AcadLWPolyline
````````````
' Explode the polyline
Dim explodedObjects As Variant
explodedObjects = plineObj.Explode

I want to use C# to write it ,please help me thinks you
Message 6 of 13
bigbignext
in reply to: bigbignext

think you,I try it, but error
Message 7 of 13
NathTay
in reply to: bigbignext

http://discussion.autodesk.com/thread.jspa?threadID=550319
Message 8 of 13
bigbignext
in reply to: bigbignext

I get it
C# code:
AcadLWPolyline plineObj;
```````````````
Object[] explodedObjects;
explodedObjects=(Object[])plineObj.Explode();
if((explodedObjects[0] as AcadLine)!=null)
MessageBox.Show(((AcadLine)explodObjects0]).EntityName);
Message 9 of 13
Anonymous
in reply to: bigbignext

If you want to use C# you have to learn
how to use C# first.

http://msdn.microsoft.com/vstudio/express/beginner/

--
http://www.caddzone.com

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

wrote in message news:5520476@discussion.autodesk.com...
think you,I try it, but error
Message 10 of 13
Anonymous
in reply to: bigbignext

And, you need to be more attentive when reading posts.

Davis

"Tony Tanzillo" wrote in message
news:5520720@discussion.autodesk.com...
If you want to use C# you have to learn
how to use C# first.

http://msdn.microsoft.com/vstudio/express/beginner/

--
http://www.caddzone.com

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

wrote in message news:5520476@discussion.autodesk.com...
think you,I try it, but error
Message 11 of 13
Anonymous
in reply to: bigbignext

Mosquito, go find a bug light.

--
http://www.caddzone.com

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

"CADJunkie" wrote in message news:5520732@discussion.autodesk.com...
And, you need to be more attentive when reading posts.

Davis

"Tony Tanzillo" wrote in message
news:5520720@discussion.autodesk.com...
If you want to use C# you have to learn
how to use C# first.

http://msdn.microsoft.com/vstudio/express/beginner/

--
http://www.caddzone.com

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

wrote in message news:5520476@discussion.autodesk.com...
think you,I try it, but error
Message 12 of 13
Anonymous
in reply to: bigbignext

perhaps a more fundamental question is in order here. if you already know
VBA [perhaps you don't but for arguments sake let's say you do], then why
would you want to switch horses in midstream? unless you're a professional
programmer there is not much to be gained by going to c#. examine your
motivation to choose c#. if it's necessary you may want to consider vb.net.

bob

wrote in message news:5520608@discussion.autodesk.com...
I get it
C# code:
AcadLWPolyline plineObj;
```````````````
Object[] explodedObjects;
explodedObjects=(Object[])plineObj.Explode();
if((explodedObjects[0] as AcadLine)!=null)
MessageBox.Show(((AcadLine)explodObjects0]).EntityName);
Message 13 of 13
Anonymous
in reply to: bigbignext

now, you're being too nice.
These super beginner posts are starting to make mine look good!

Tony Tanzillo
|>Mosquito, go find a bug light.
|>
|>--
|>http://www.caddzone.com
|>
|>AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
|>http://www.acadxtabs.com
|>
|>"CADJunkie" wrote in message news:5520732@discussion.autodesk.com...
|>And, you need to be more attentive when reading posts.
|>
|>Davis
|>
|>"Tony Tanzillo" wrote in message
|>news:5520720@discussion.autodesk.com...
|>If you want to use C# you have to learn
|>how to use C# first.
|>
|>http://msdn.microsoft.com/vstudio/express/beginner/
James Maeding
Civil Engineer and Programmer
jmaeding - at - hunsaker - dotcom

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