-
Re: How to get the second entity attached to an annotation? (VBA)
Manikandan Babu Aug 1, 2017 2:54 AM (in response to Nishihama Sayuri)Hi Sayuri,
I have tried with below to code finding the second entity.
Even i have tried for multiple dimension,it is working fine.
Dim swApp As SldWorks.SldWorks
Dim swmodel As SldWorks.ModelDoc2
Dim swdraw As SldWorks.DrawingDoc
Dim swview As SldWorks.View
Dim Annotations As Variant
Dim swann As SldWorks.Annotation
Dim swentity As SldWorks.Entity
Dim vAttEntTypeArr As Variant
Sub main()
Set swApp = Application.SldWorks
Set swmodel = swApp.ActiveDoc
Set swdraw = swmodel
Set swview = swdraw.GetFirstView
Set swview = swview.GetNextView
Annotations = swview.GetAnnotations
Set swann = Annotations(1)
vAttEntArr = swann.GetAttachedEntities3
Set swentity = vAttEntArr(1)
swentity.Select True
End Sub
Manikandan
-
Re: How to get the second entity attached to an annotation? (VBA)
Nishihama Sayuri Aug 1, 2017 4:55 AM (in response to Manikandan Babu)Hi Manikandan. Thank you for your reply !
I tried your code and it works fine in .slddrw.
But I tried it to DimXpert dimension in .sldprt, [swAnn.GetAttachedEntities3] doesn't work correctly.
So I'm going to try another way to get those entities.
I appreciate your help anyway!
ps sorry for my poor english...
-
Re: How to get the second entity attached to an annotation? (VBA)
Manikandan Babu Aug 1, 2017 7:23 AM (in response to Nishihama Sayuri)Hi Sayuri,
Try this for Dimxpert dimension, Add reference for dimxpert.
Dim swApp As SldWorks.SldWorks
Dim swmodel As SldWorks.ModelDoc2
Dim swSchema As SldWorks.DimXpertManager
Dim swDXPart As SwDimXpert.DimXpertPart
Dim Annotations As Variant
Dim swdim As SwDimXpert.DimXpertAnnotation
Dim swfeat As SwDimXpert.DimXpertFeature
Dim faces As Variant
Dim swent As SldWorks.Entity
Sub main()
Set swApp = Application.SldWorks
Set swmodel = swApp.ActiveDoc
Set swSchema = swmodel.Extension.DimXpertManager("Default", True)
Set swDXPart = swSchema.DimXpertPart
Annotations = swDXPart.GetAnnotations
Set swdim = Annotations(0)
Set swfeat = swdim.Feature
faces = swfeat.GetFaces
Set swent = faces(1)
swent.Select True
End Sub
Manikandan
-
Re: How to get the second entity attached to an annotation? (VBA)
Nishihama Sayuri Aug 7, 2017 8:32 AM (in response to Manikandan Babu)Hi Manikandan, Thank you for your reply !
[Get Feature] And [Get Faces]. I see.
I'll try again.
-
-
-