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

Help with this one before I hurt myself, lol

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
221 Views, 2 Replies

Help with this one before I hurt myself, lol

Hi Guys and Gals,


Dim acSSet As SelectionSet = acSSPrompt.Value
For Each acSSobj As SelectedObject In acSSet
If Not IsDBNull(acSSobj) Then
Dim acEnt As Entity = acTrans.GetObject(acSSobj.ObjectId, OpenMode.ForWrite)
If Not IsDBNull(acEnt) Then
acEnt.ColorIndex = 9
Dim FetchObj As Object = acTrans.GetObject(acSSobj.ObjectId, OpenMode.ForRead)
Dim myCircle As Circle
Dim pt As Point3d = myCircle.Center
End If
End If
Next

I am hitting my head against the wall. This is code from the .NET Developers Guide which changes the color of a circle.

I think I just about got it right. Is anyone willing to look at this and suggest a direction to go. Please.

And have a great Thanksgiving.

THX,
Dan
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

What is the problem you are having?

I don't know whether this line
Dim FetchObj As Object = acTrans.GetObject(acSSobj.ObjectId, OpenMode.ForRead)
would impact on this line
Dim acEnt As Entity = acTrans.GetObject(acSSobj.ObjectId, OpenMode.ForWrite)
or why it is necessary.
Message 3 of 3
Anonymous
in reply to: Anonymous

{quote}

This is code from the .NET Developers Guide which changes the color of a
circle.

{quote}

I think not. No code in any Autodesk publication is that broken.

I would go back and look at the example code you cite, and see what's
missing in your adaptation of it, because if the example code shows how to
do what you say it does, but you can't manage to adapt it, then the problem
is that you haven't gotten the prerquisites down first (a basic
understanding of the VB.NET language), and you shouldn't rely on folks here
to help you with that.

I would suggest taking a course in VB.NET or getting some basic training on
it, or using the self-learning tools at MSDN, before even thinking about
writing any AutoCAD code.

Few people here have the time or patience to offer this kind of tutoring,
and while people here can post example code that does what you're trying to
do, that isn't really going to help very much when it comes to learning the
basics of VB.NET.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:6295432@discussion.autodesk.com...
Hi Guys and Gals,


Dim acSSet As SelectionSet = acSSPrompt.Value
For Each acSSobj As SelectedObject In acSSet
If Not IsDBNull(acSSobj) Then
Dim acEnt As Entity =
acTrans.GetObject(acSSobj.ObjectId, OpenMode.ForWrite)
If Not IsDBNull(acEnt) Then
acEnt.ColorIndex = 9
Dim FetchObj As Object =
acTrans.GetObject(acSSobj.ObjectId, OpenMode.ForRead)
Dim myCircle As Circle
Dim pt As Point3d = myCircle.Center
End If
End If
Next

I am hitting my head against the wall. This is code from the .NET Developers
Guide which changes the color of a circle.

I think I just about got it right. Is anyone willing to look at this and
suggest a direction to go. Please.

And have a great Thanksgiving.

THX,
Dan

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