×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Can't see new reference set

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.

RE: Can't see new reference set

What version of NX?

And, can you post the relevant section of code you have so far?

www.nxjournaling.com

RE: Can't see new reference set

check your layer settings

RE: Can't see new reference set

(OP)
cowski, I am currently using NX 9. The code I have below checks to see if a given part has a segment, and if so populate that segment into the given 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

(OP)
jerry1423, it appears that when I try to set a line segment to a layer, it will show up on the screen which is good news! However, when I try setting different segments to the same layer, they aren't displayed. Do you know what would be the proper layer settings for an arc or spline segment?

RE: Can't see new reference set

I'm not familiar with the routing module, so I have a basic question...

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources