cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Export point coordinates with JLink

dgarcia
12-Amethyst

Export point coordinates with JLink

     I have an assembly with a component that has a component which has a Coordinate System Point defined.

I am trying to read and export the dimensions of the point to a text file with JLink.

I have followed the instructions of the example in Creoview 2.0, which gives something like this:

public static void writeDatumPointFeatureProperties(Feature feat)    {
try {     
   DatumPointFeat pointfeat = (DatumPointFeat)feat;                          
   String datumpointfeatname = (pointfeat.GetFeatName());

   if (points == null)
      printMsg ("       - No General Datum Points (null)");
   else if (points.getarraysize() < 0)                      
      printMsg ("       - No General Datum Points");             
  else  {                    
       printMsg ("       - No of points = " +points.getarraysize() );
       for (int j = 0 ; j<  points.getarraysize() ; j++)      {

... and so on

My problem is that I always get points.getarraysize() = 0, so I cannot go on.

How can I do this?

Best regards

Daniel


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
1 REPLY 1
FV
17-Peridot
17-Peridot
(To:dgarcia)

Hi all,

Daniel, you could not get non-zero value from  points.getarraysize() because you had never added point elements to the 'points' array.

You are missing a call to GetPoints() method: GeneralDatumPoints points = pointfeat.GetPoints(); or something similar. It is strange that you had been able to compile this code because 'points' variable had not been declared in method's scope...

Feliks.

Announcements
NEW Creo+ Topics: Real-time Collaboration


Top Tags