Can't see new reference set
Can't see new reference set
(OP)
My goal is to create a new reference set for each model-part from a given component. The reference set is supposed to show line segments, ARC segments, and Spline segments. I am able to create a new reference set for each model-part, but now I am stuck on how to add the objects to the reference sets. I'm using addObjectsToReferenceSet(), and looking at the log shows that it has been added to the reference set. However, when I try to replace the reference set to the one I just created, the part shows up blank. I have also noticed this message:
Assembly Navigator: Deferred node update outside transactions is enabled
come up after I create a reference set, but I haven't been able to find out what it means. Is there a reason why I can't see the result of the new reference set, or is there a display method I'm missing?
Thanks for your time.
Assembly Navigator: Deferred node update outside transactions is enabled
come up after I create a reference set, but I haven't been able to find out what it means. Is there a reason why I can't see the result of the new reference set, or is there a display method I'm missing?
Thanks for your time.





RE: Can't see new reference set
And, can you post the relevant section of code you have so far?
www.nxjournaling.com
RE: Can't see new reference set
RE: Can't see new reference set
CODE --> Java
partList = getParts(compList, myComponent); ArrayList<ReferenceSet> newRefSet = new ArrayList<ReferenceSet>(); for (int index = 0; index < partList.size(); index++) { // check to see if part has segments, and if so add it to the // correct reference set if (hasSegment(partList.get(index)) != true) { NXLogger.println("There is no segment"); } else { NXLogger.println("There are segments!"); newRefSet.add(createNewSynRefSet(partList.get(index))); /* * Add the segments from a part to the new reference set. I was * hoping that each part had it's own segments, but it appears * they all are inside the component. */ for (int x = 0; x < newRefSet.size(); x++) { populateRefSet(partList.get(index), newRefSet.get(x)); } } }CODE --> Java
@SuppressWarnings("unchecked") private static void populateRefSet(Part compPart, ReferenceSet refSet) throws RemoteException, NXException { NXLogger.println("Entering populateRefSet()"); /**************************************/ /* add line segment objects to reference set */ /**************************************/ LineSegmentCollection lines = compPart.segmentManager().lineSegments(); // get the iterator Iterator<LineSegment> lineIterator = lines.iterator(); NXObject[] addLines = new NXObject[1]; int segmentCount = 0; for (TaggedObjectCollection.Iterator ii = lines.iterator(); ii .hasNext();) { segmentCount++; ii.next(); NXLogger.println("found line segment"); } NXLogger.println("Number of line segments found: " + segmentCount); while (lineIterator.hasNext()) { LineSegment line = lineIterator.next(); if (line.getIsSegmentInterior() == nxopen.routing.Interior.NOT_INTERIOR_TO_PART) { addLines[0] = line; line.setLayer(1); refSet.addObjectsToReferenceSet(addLines); NXLogger.println("add line segment under layer " + line.layer()); } else { NXLogger.println("find a interior line"); } }CODE --> Java
private static boolean hasSegment(Part compPart) throws RemoteException, NXException { NXLogger.println("Entering hasSegment()"); NXLogger.println("Using part: " + compPart.name()); boolean found = false; int segmentCount = 0; /* check line segment */ /* * Within compPart, tell segmentManager to look for line segments and * store it in a collection called lines */ LineSegmentCollection lines = compPart.segmentManager().lineSegments(); for (TaggedObjectCollection.Iterator ii = lines.iterator(); ii .hasNext();) { segmentCount++; ii.next(); NXLogger.println("found line segment"); }RE: Can't see new reference set
RE: Can't see new reference set
What part "owns" these routing objects (segments)? Are they created in the component part file and shown in the assembly or are they created in the assembly?
If they are created in the assembly file, they cannot be added to the component's reference set.
www.nxjournaling.com