Reference dialog discrepancy

I have on several occasions noticed differences between the 'Contains' tab and what appears when I click the 'Edit User Defined References' button.  Typically, the latter is empty, like this:

Is this a bug or am I missing some subtle feature?

Jim S.

SolidworksSolidworks Pdm enterprise Pdm
Answers 8
SF
SF 2010-05-03 Best Answer

Jim,

I am just starting out as well, but what you are seeing are BOM references in one case and user defined references in the other.  The user defined references are created by using the "copy" and "paste as reference" functionality, which for example would be used for attaching a document to an assembly or part where you don't want it on a bill of material.

Peregrin

JS
JS 2010-05-03
<p>Peregrin Maksimovich wrote:</p><p></p><p>Jim,</p><p></p><p>I am just starting out as well, but what you are seeing are BOM references in one case and user defined references in the other.  The user defined references are created by using the "copy" and "paste as reference" functionality, which for example would be used for attaching a document to an assembly or part where you don't want it on a bill of material.</p><p></p><p>Peregrin</p>

Everything in the view on the left was created using 'Paste As Reference'.  In a seemingly random fashion, the user-defined references are 'cleared' on check-in.  They will still show up in the 'Contains' tab.  They will still show up as referenced during check-in and check-out.  However, the instant you paste a new file as a reference, the old references are deleted and only the new one exists.

Jim S.

JS
JS 2010-05-05

We are still struggling with ths problem.  We think it is isolated in a small piece of code running in a home-grown C# add-in, but the code is so simple, I think it is exposing a bug either in the API or in EPDM itself.  Attached is the bare bones (only 68 lines)code that I created that still exhibits the problem.  If we have any API experts reading this thread I would appreciate it if you could look at and/or test it and see if there is anything wrong with the code.

The add-in is pretty simple.  It expects a folder with a number of .txt files:  one to act as the parent file (I called mine 'parent.txt') and a series of child files named '0.txt' through '9.txt'.  When the add-in is running, right clicking on the 'parent.txt' file (which should be checked in) and selecting 'Add Single' from the context menu will execute the code.

The code checks out the parent and adds the next child in numerical order as a reference to the parent.  The parent is then checked in to create a new version, but it remains checked out so that further additions can be made if necessary.

When the references are misbehaving, selecting 'Add Single'  once and then checking in the parent will put the file into a state where the contains tab shows a reference, but clicking the 'Edit user defined references' button will show ''.  Checking in/out will still list all the references, but adding another reference will erase any exisiting items in the contains tab, and from the file.  It doesn't happen every time, but once in this state, it is repeatable after every 'Add Single' operation.

Thanks.

Jim S.

SF
SF 2010-05-05

Try what you're attempting to do without using the API. I just tested your scenario and it's working here. (2010 SP0)

JS
JS 2010-05-05
<p>Lee Young wrote:</p><p></p><p>Try what you're attempting to do without using the API. I just tested your scenario and it's working here. (2010 SP0)</p>

I have not been able to reproduce it outside of the custom code.  This is what leads me to believe it is a problem in the API.  There are subtle differences in the way references are added via the API vs. Windows Explorer.  The API even makes a distinction.  If you look at the API docs for IEdmAddCustomRefs, there are three ways to add references:

  • AddReferencesClipboard
  • AddReferencesID
  • AddReferencesPath

Explorer uses the first one.  I'm using the second one.  I also see the problem if I use the AddReference method of the IEdmEnumeratorCustomReference5 class.

Jim S.

BD
BD 2012-02-08

I'm pretty new to this, but I noticed that your code does not seem to jibe with the example in the help file.  Specifically:

--------------------------------------------------------------------------------------------

To create new references:

  1. Create the IEdmAddCustomRefs interface.
  2. Call AddReferencesClipboard, AddReferencesID, or AddReferencesPath once or more.
  3. Call the CreateTree method to compute the reference tree.
  4. Optionally call ShowDlg to display to the user what you are about to do.
  5. Call CreateReferences to create the new references.

--------------------------------------------------------------------------------------------

I see where you performed step 2, but no sign of step 3 (CreateTree) or step 5 (CreateReferences).  I haven't done references through the API yet, but I wonder if adding these other two steps may be required.

Just a thought....

RH
RH 2015-05-04

We are experiencing the same issue however we are not running any custom add-ins. Does anyone know besides pasted references what other ways are items added to the contains tab for an item?

I did notice that the items that are shown in the contains folder are typically parts or assemblies used within that assembly or assembly drawing. Could this be a possible cause of this?

-Rick H

SF
SF 2015-05-06

Hey Rick,

You are correct, anything that's used in an assembly automatically gets added to the contains tab, that's actually it's main purpose. So files that don't exist in the User Defined dialog are files that got created automatically.