Message 1 of 2
Having trouble with WorkPoints.AddByCurveAndEntity
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to make a rule that creates a workpoint at the intersection of a the YZ plane and an edge using ilogic. The edge will be in the named entity (called Edge0 right now) tab in under ilogic. I will worry about [ProximityPoint] later. I don't think this is too hard, but I am a beginner with ilogic and I couldn't find something on here that explained it in a way I could understand. Here's what I wrote
Dim partDoc As PartDocument = ThisDoc.ModelDocument oDef = ThisDoc.Document.ComponentDefinition Dim namedEntities = iLogicVb.Automation.GetNamedEntities(partDoc) Dim Edge0 As Edge = namedEntities.FindEntity("Edge0") Dim YZ As WorkPlane = oDef.WorkPlanes("YZ Plane")
Dim oWPoint As WorkPoint oWPoint = WorkPoints.AddByCurveAndEntity(Edge0, YZ)
The error I am getting is Error on Line 17 : Reference to a non-shared member requires an object reference. I've tried making both the curve and the edge different types of objects. What am I doing wrong?
I'm sure its easy. Unfortunately, I'm just getting started with ilogic and programming in general.
Thanks in advance.