Quantcast
Channel: NX Journaling - Journaling / NXOpen API
Viewing all articles
Browse latest Browse all 783

temporary point on facet body using cycleFacet

$
0
0

Good Afternoon, I am new to NXOpen and have tried to make temporary point on facet body.
In my code, there is a problem on "Tag facetModel".

I don't know well how this cycleFacet works and what i need to put in facetmodel
could you give me some guidance, please?

using NXOpen;
using NXOpen.UF;
using System.Collections.Generic;
 
public class asd
{
  public static void Main()
  {
    Session theSession = Session.GetSession();
    Part workpart = theSession.Parts.Work;
    UFSession theUfSession = UFSession.GetUFSession();
 
    UFObj.DispProps attrib = new UFObj.DispProps();
    attrib.color = 186;
 
    List<double[]> verts = new List<double[]>();
    int facetid = UFConstants.UF_FACET_NULL_FACET_ID;
 
    Tag facetModel = workpart.FacetedBodies.Tag;
    theUfSession.Facet.CycleFacets(facetModel, ref facetid);
 
    while (facetid != UFConstants.UF_FACET_NULL_FACET_ID)
 
    {
 
      int numvertices;
      theUfSession.Facet.AskNumVertsInFacet(facetModel, facetid, out numvertices);
 
      double[,] vertices = new double[numvertices, 3];
      theUfSession.Facet.AskVerticesOfFacet(facetModel, facetid, out numvertices, vertices);
 
      for (int i = 0; i < numvertices; i++)
      {
        double[] coords = new double[] { vertices[i, 0], vertices[i, 1], vertices[i, 2] };
 
        theUfSession.Disp.DisplayTemporaryPoint(Tag.Null, UFDisp.ViewType.UseWorkView, coords, ref attrib, UFDisp.PolyMarker.Asterisk);
      }
      theUfSession.Facet.CycleFacets(facetModel, ref facetid);
    }
  }
}

Viewing all articles
Browse latest Browse all 783

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>