- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Using iLogic to create a linear dimension between two ProxyWorkPoint's
As the title, I have created proxy work points and I wish to create a linear dimension between them. The gap in my knowledge is how I turn the WorkPointProxy's into a GeometeryIntent's.
Dim oModelDoc = ActiveSheet.View(viewname).ModelDocument Dim oAssemblyDoc As AssemblyDocument = oModelDoc Dim oPartOcc = oAssemblyDoc.ComponentDefinition.Occurrences.ItemByName("my part") 'Name of part in assembly Dim oPartDoc As PartDocument = oPartOcc.Definition.Document Dim oNamedEntities = iLogicVb.Automation.GetNamedEntities(oPartDoc) oDetailView = oSheet.DrawingViews.Item(2)'1 for main view, 2 for detail view. Dim oGenDims As GeneralDimensions = oSheet.DrawingDimensions.GeneralDimensions Dim oWPN3 As WorkPoint = oNamedEntities.FindEntity("WPN3") Dim oWPN3Proxy As WorkPointProxy oPartOcc.CreateGeometryProxy(oWPN3, oWPN3Proxy) Dim oWPN2 As WorkPoint = oNamedEntities.FindEntity("WPN2") Dim oWPN2Proxy As WorkPointProxy oPartOcc.CreateGeometryProxy(oWPN2, oWPN2Proxy) oGenDims.AddLinear(oTG.CreatePoint2d(5,5), oWPN2, oWPN3)
If you look at the last line I have inserted two WorkPointProxy's as my GeometryIntent's. I know this is wrong. How do I make the conversion to the correct data type?
Many thanks,
Harvey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
GOOD MORNING!
Here is a snippet of code i used to find the proxy on a 'shelf' object and then create the geometry intent with proxy plane for creating a dim.
I'm a little busy at work at the moment, but hopefully this helps you sort it out.
'set ref to each shelf Dim Assembly As ComponentOccurrence For Each Assembly In ModelFile.ComponentDefinition.Occurrences If InStr(Assembly.Name, "Shelf") >= 1 Then For Each WPlane In Assembly.Definition.WorkPlanes If WPlane.Name = "Top" Then Dim ShelfProxy As WorkPlaneProxy Assembly.CreateGeometryProxy(WPlane, ShelfProxy) Dim oShelfIntent As GeometryIntent oWorkSurface = oActiveSheet.Centerlines.AddByWorkFeature(ShelfProxy, DrawingView) oShelfIntent = oActiveSheet.CreateGeometryIntent(oWorkSurface, kEndPointIntent) oWorkSurface.Visible = False Call oDimGeoIntent.Add(oShelfIntent) Exit For End If Next End If Next
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have created similar example due to the copyright nature of the original. This is what I would like to do in the UI:
I have attached all the files if someone would like to have a look.
Thanks,
Harvey