Reply

how to access hole from model

[ Edited ]

 

hi everybody,

i want to access holedata and hole object from model.

The problem is that i get objHoles.Count =1. And with this i can access third hole in hole collection where i actually want to access first hole. 

When i use HoleDataCollection sount =3

Can anyone tell me why this is happening. Am using SE-19

 i used following procedure......

 

 

objHoles As SolidEdgePart.Holes = objDoc.Models.Item(1).Holes

 

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

"& this code to get hole count"

Dim

objHDColl = objDoc.HoleDataCollection

 

 

 

 

              holeData(j - 1) = objHDColl.Item(holeCount)

 objHDColl As SolidEdgePart.HoleDataCollectionDim holeCount AsInteger = objHDColl.CountDim holeData(holeCount - 1) As HoleDataFor j AsInteger = 1 To holeCountNext

 

MsgBox(objHoles.Count)

"i used this code to get hole object"

Dim

 

Posted by: makarand kulkarni
Post date: 9/21/2009 7:10:20 PM

3 REPLIES

RE: how to access hole from model

[ Edited ]

You made a mistake.

To get the holes collection:

objHoles As SolidEdgePart.Holes = objDoc.Models.Item(1).Holes

To get the first hole

objHole as SolidEdgePart.Hole = objHoles.Item(1)

To get the related HoleData object

objHoleData as SolidEdgePart.HoleData = objHole.HoleData

 

There can be several HoleData objects in your file even if you only have got one hole. HoleDataCollection is not the collection of existing holes in your file, but a collection of different holedata definitions (Threaded, counterbored, etc) and they can exist even if they have not been applied to any hole in your file.

Hope this helps,

Julian

 

Posted by: Julian Guillo
Post date: 9/22/2009 12:25:18 AM

RE: how to access hole from model

[ Edited ]

I forgot this,

Of course the hole count in your file is:

objHoles.Count not objHDColl.Count as you were doing.

Regards,

Julian

 

Posted by: Julian Guillo
Post date: 9/22/2009 12:27:33 AM

RE: how to access hole from model

[ Edited ]

 

Thanks a lot Julian

 

Posted by: makarand kulkarni
Post date: 9/25/2009 9:06:14 PM