.NET

Reply
Active Contributor
ahmed.felix
Posts: 38
Registered: ‎08-31-2006
Message 1 of 7 (233 Views)

IntersectWith issue (possible bug)

233 Views, 6 Replies
02-12-2007 10:57 AM
IntersectWith() is only working with the first segment of a polyline. Anybody knows why is this?

Reproducing the problem: draw a circle, then draw a polyline over it (both of them manually in AutoCAD) and get the intersections (programatically). If it's a multiple segment polyline it will only return the intersections where the circle crossed the first segment regardles of how many intersections with the polyline really exist.
*Paul Richardson
Message 2 of 7 (233 Views)

Re: IntersectWith issue (possible bug)

02-15-2007 06:59 PM in reply to: ahmed.felix
It works for me using 07. What version are you using - post your code.

wrote in message news:5483877@discussion.autodesk.com...
IntersectWith() is only working with the first segment of a polyline.
Anybody knows why is this?

Reproducing the problem: draw a circle, then draw a polyline over it (both
of them manually in AutoCAD) and get the intersections (programatically). If
it's a multiple segment polyline it will only return the intersections where
the circle crossed the first segment regardles of how many intersections
with the polyline really exist.
Active Contributor
ahmed.felix
Posts: 38
Registered: ‎08-31-2006
Message 3 of 7 (233 Views)

Re: IntersectWith issue (possible bug)

02-16-2007 02:54 PM in reply to: ahmed.felix
Dim objDrawingSpace As New DrawingSpace.DrawingSpace
Dim entObject1 As Entity
Dim entObject2 As Entity
Dim acadDB As Database = HostApplicationServices.WorkingDatabase
Dim acadTrans As Transaction = acadDB.TransactionManager.StartTransaction

entObject1 = objDrawingSpace.GetEntity("Select Object 1", acadTrans)
entObject2 = objDrawingSpace.GetEntity("Select Object 2", acadTrans)

Dim colIntersection As New Point3dCollection

entObject1.IntersectWith(entObject2 , Intersect.OnBothOperands, colIntersection, 1, 1)

MsgBox(colIntersection.Count)

objDrawingSpace.GetEntity is a function that just prompts a message to the command line and returns the object selected by the user. I've tried different scenarios, like a drawing a line and then drawing a polyline zigzagging over it, still returns only 1 intersection even though there were really 10. I'm using Autocad 2006 and Visual Studio 2005
*Paul Richardson
Message 4 of 7 (233 Views)

Re: IntersectWith issue (possible bug)

02-16-2007 05:48 PM in reply to: ahmed.felix
Use 0, 0 instead of 1, 1 for your graphics markers. 0 is the default - none
used.
wrote in message news:5490211@discussion.autodesk.com...
Dim objDrawingSpace As New DrawingSpace.DrawingSpace
Dim entObject1 As Entity
Dim entObject2 As Entity
Dim acadDB As Database = HostApplicationServices.WorkingDatabase
Dim acadTrans As Transaction =
acadDB.TransactionManager.StartTransaction

entObject1 = objDrawingSpace.GetEntity("Select Object 1", acadTrans)
entObject2 = objDrawingSpace.GetEntity("Select Object 2", acadTrans)

Dim colIntersection As New Point3dCollection

entObject1.IntersectWith(entObject2 , Intersect.OnBothOperands,
colIntersection, 1, 1)

MsgBox(colIntersection.Count)

objDrawingSpace.GetEntity is a function that just prompts a message to the
command line and returns the object selected by the user. I've tried
different scenarios, like a drawing a line and then drawing a polyline
zigzagging over it, still returns only 1 intersection even though there were
really 10. I'm using Autocad 2006 and Visual Studio 2005
Active Contributor
ahmed.felix
Posts: 38
Registered: ‎08-31-2006
Message 5 of 7 (233 Views)

Re: IntersectWith issue (possible bug)

02-17-2007 10:22 AM in reply to: ahmed.felix
Thanks! It works now. The problem was exactly that, I didn't know what the graphics markers meant or were for, and since everything else seemed to be working fine I assumed 1,1 was ok.
Valued Contributor
pellacad
Posts: 73
Registered: ‎04-19-2006
Message 6 of 7 (233 Views)

Re: IntersectWith issue (possible bug)

01-10-2010 09:57 AM in reply to: ahmed.felix
Paul and Ahmed,

Why would this line of code...

Dim colIntersection As New Autodesk.AutoCAD.Geometry.Point3dCollection

...generate this error...

"The specified module could not be found."

I am supremely stuck.
Valued Contributor
pellacad
Posts: 73
Registered: ‎04-19-2006
Message 7 of 7 (233 Views)

Re: IntersectWith issue (possible bug)

01-10-2010 02:04 PM in reply to: ahmed.felix
Why would this code not be recognized in my program (when I try to copy and use the above sub.)

"Dim objDrawingSpace As New DrawingSpace.DrawingSpace"
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.