cancel
Showing results for 
Search instead for 
Did you mean: 

try to information of feature in drawing

Experimenter
Experimenter

Hello everybody,

 

i try to retrieve information of pointset in my drawing for make a table of point but when i want doing a research in my list of feature i have not error but the code don't finf feature ??

 

a little part of my code (this code is executed in drawing mode):

 

For Each myFeature As Features.Feature In s.Parts.Work.Features
If TypeOf (myFeature) Is Features.PointSet Then
lw.WriteLine(".GetFeatureName: " & myFeature.GetFeatureName)
lw.WriteLine(".Name: " & myFeature.Name)
lw.WriteLine(".FeatureType: " & myFeature.FeatureType)
lw.WriteLine(".Timestamp: " & myFeature.Timestamp.ToString)
lw.WriteLine("")

Dim myPoints() As NXObject = myFeature.GetEntities

For Each tempPt As Point In myPoints
lw.WriteLine(tempPt.Coordinates.ToString)
Next

End If

Next

 

 

in the lw view i have nothing...

 

 

thanks a lot in advance,

laurent.

3 REPLIES

Re: try to information of feature in drawing

Honored Contributor
Honored Contributor

Is your drawing contained in the same file as the model? Or have you added the model as a component of the drawing file (master model method)?

 

If you are using the master model method, you will need to take care to reference the correct part file. The code is looking at the features in the "workPart"; if the "workPart" variable references the drawing file, the point set will not be found. Instead of looking at the work part, make sure you are referencing the model part.

Re: try to information of feature in drawing

Experimenter
Experimenter

thank you very much !!!

 

yes i have separate drawing and i make :

 

Dim s As Session = Session.GetSession()

Dim workPart As Part = s.Parts.Work

 

but when i do that the workpart is the drawing and not the part of course!!!

 

how can i find the list of part attached to the drawing ?

 

 

 

Re: try to information of feature in drawing

Valued Contributor
Valued Contributor

Run this to get all parts.

Run through all of them.

Hope you will get it.

 

For Each pa As Part In theSession.Parts

Next