Message 1 of 9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hy All
Again I need some help.
In assembly I want to create a new sketch that projects only the studs (and not any hole) that are on the sheet and the inner edges of the sheet too. Then I would export it as a dxf.
I saw here in the forum that this can be achieved with the CreateGeometryProxy or AddProjectingEntity
but I couldn’t figure out how because I lack the necessary knowledge.
Any help will be very appreciated many thanks
I've found this code but here I have to select the entity to project manually
Dim oAssemDoc As AssemblyDocument = ThisApplication.ActiveDocument
Dim oAssemDef As AssemblyComponentDefinition = oAssemDoc.ComponentDefinition
'Select face on part document
Dim oFace As Object = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFacePlanarFilter, "Select face on part for new sketch")
If oFace Is Nothing Then Exit Sub
Dim oOcc As ComponentOccurrence = oFace.ContainingOccurrence
oOcc.Edit
'Active part document within an open assembly
Dim oPartDoc As PartDocument = ThisApplication.ActiveEditDocument
Dim oPartDef As PartComponentDefinition = oPartDoc.ComponentDefinition
Dim oSketch As PlanarSketch = oPartDef.Sketches.Add(oFace.NativeObject)
oSketch.Edit
oSketch.Name = "ocSketch"
'oSketch.ExitEdit
' Dim oPointProxy As ObjectTypeEnum = oSketch.SketchPoints
Dim oEntity As Object = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceFilter, "Select entity to project")
'Dim oEntity As Object = oFace
If oEntity Is Nothing Then Exit Sub
Dim oEntityOcc As ComponentOccurrence = oEntity.ContainingOccurrence
oEntityOcc.CreateGeometryProxy(oEntity, oEntityProxy)
oOcc.CreateGeometryProxy(oSketch, oSketchProxy)
oSketchProxy.AddByProjectingEntity(oEntityProxy)
Solved! Go to Solution.