makyy
Automotive
- Mar 2, 2021
- 19
Hello everyone,
I made an intersection macro. The first element is automatically selected while the second element is to be selected by the user.
I tried InputObjectType(0)="AnyObject", but when I select PartBody from my specification tree it ends up in not selecting anything at all.
The code is selecting planes, surfaces ,edges, etc smoothly..
Like in intersection we can select wireframe elements,solid elements and surfaces ,I want the same thing with my macro.Any help will be appreciated.
the code that I created is:
Dim InputObject()
ReDim InputObject(0)
InputObject(0) = "AnyObject"
Dim reference4 As reference
Set reference4 = oPart.CreateReferenceFromObject(hybridShapeFill1)
Dim Status4 As String
Status4 = oSec.SelectElement2(InputObject, _
"Select 2nd element to proceed with intersection。", False)
If (Status4 = "Cancel") Or (Status4 = "Undo") Then
Exit Sub
End If
Dim reference5 As reference
Set reference5 = oSec.Item(1).reference
Dim hybridShapeIntersection1
Set hybridShapeIntersection1 = hybridShapeFactory1.AddNewIntersection(reference4, reference5)
hybridShapeIntersection1.PointType = 0
hybridBody1.AppendHybridShape hybridShapeIntersection1
oPart.InWorkObject = hybridShapeIntersection1
oPart.Update
oSec.Clear
I made an intersection macro. The first element is automatically selected while the second element is to be selected by the user.
I tried InputObjectType(0)="AnyObject", but when I select PartBody from my specification tree it ends up in not selecting anything at all.
The code is selecting planes, surfaces ,edges, etc smoothly..
Like in intersection we can select wireframe elements,solid elements and surfaces ,I want the same thing with my macro.Any help will be appreciated.
the code that I created is:
Dim InputObject()
ReDim InputObject(0)
InputObject(0) = "AnyObject"
Dim reference4 As reference
Set reference4 = oPart.CreateReferenceFromObject(hybridShapeFill1)
Dim Status4 As String
Status4 = oSec.SelectElement2(InputObject, _
"Select 2nd element to proceed with intersection。", False)
If (Status4 = "Cancel") Or (Status4 = "Undo") Then
Exit Sub
End If
Dim reference5 As reference
Set reference5 = oSec.Item(1).reference
Dim hybridShapeIntersection1
Set hybridShapeIntersection1 = hybridShapeFactory1.AddNewIntersection(reference4, reference5)
hybridShapeIntersection1.PointType = 0
hybridBody1.AppendHybridShape hybridShapeIntersection1
oPart.InWorkObject = hybridShapeIntersection1
oPart.Update
oSec.Clear