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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

How to Get the X,Y,Z Coordinates of a Point Object From the Model?

ddhini
14-Alexandrite

How to Get the X,Y,Z Coordinates of a Point Object From the Model?

I have a Model ,I need to Extract the Coordinates Position(X,Y,Z) of Point Object based on a default Coordinate System.I can able to Extract the Point Coordinates by the Following Code.Please look on the Following Code 

 

public static void writeDatumPointFeatureProperties(Feature Pointfeat) throws IOException
       {
            
                   DatumPointFeat pointfeat = (DatumPointFeat)feat;
                     String datumpointfeatname = (pointfeat.GetFeatName());
                    System.out.println (" DatumFeatPointName =" +datumpointfeatname);
                    /* Getting points */
                    GeneralDatumPoints points = pointfeat.GetPoints();
                     if (points == null)
                           System.out.println (" - No General Datum Points (null)");
                    
                    else if (points.getarraysize() < 0)
                           
                           System.out.println (" - No General Datum Points");
                    
                    else
                    {
                           System.out.println (" - No of points = " +points.getarraysize() );
                                 
                           for (int j = 0 ; j< points.getarraysize() ; j++)
                                 
                           {
                                  System.out.println("+ --------- +" );
                                        
                                        String datumpointname = (points.get(j).GetName());
                                        
                                        System.out.println (" - DatumPointName =" +datumpointname);
                                        
                                        //writer.append(datumpointfeatname);
                                  //writer.append(',');
                                  
                                        //writer.append(datumpointname);
                                  //writer.append(',');
                                        /* Getting placement constraints */
                                        DatumPointPlacementConstraints placeconst =points.get(j).GetPlaceConstraints();
                                        
                                        System.out.println (" - No of Placement Constraints ="+placeconst.getarraysize());
                                               
                                        for (int k = 0 ; k< placeconst.getarraysize() ; k++)
                                               
                                        {
System.out.println("+ --------- +" ); System.out.println (" - Placement Constraint Ref Id ="+placeconst.get(k).GetConstraintRef().GetSelItem().GetId()); System.out.println (" - Placement Constraint Ref Name ="+placeconst.get(k).GetConstraintRef().GetSelItem().GetName()); System.out.println (" - Placement Constraint Type ="+placeconst.get(k).GetConstraintType().getValue()); System.out.println (" - Placement Constraint Value =" +placeconst.get(k).GetValue()); } /* Getting dimension constraints */ DatumPointDimensionConstraints dimconst =points.get(j).GetDimConstraints(); System.out.println (" - Number of Dimension Constraints ="+dimconst.getarraysize()); for (int m = 0 ; m< dimconst.getarraysize() ; m++) { System.out.println("+ --------- +" ); System.out.println (" - Dimension Constraint Ref Id ="+dimconst.get(m).GetConstraintRef().GetSelItem().GetId()); System.out.println (" - Dimension Constraint Ref Name ="+dimconst.get(m).GetConstraintRef().GetSelItem().GetName()); System.out.println (" - Dimension Constraint Type ="+dimconst.get(m).GetConstraintType().getValue()); System.out.println (" - Dimension Constraint Value ="+dimconst.get(m).GetValue()); continue; } }/* end of else if */ }

 

I can able to fetch the X,Y ,Z Co ordinates of a Point by the above code.But When I constructed a Point with two Constraints it will not show the Last value.(For Ex : X,Y Extracted but Z not).Actually i need Analysis ==> Measure ==> Something Like this ,please Guide me to the Solution .

 

Thanks Regards,

Dinesh

0 REPLIES 0
Top Tags