How to remove reference to Content Libary from part?

How to remove reference to Content Libary from part?

peter.roman
Advocate Advocate
421 Views
4 Replies
Message 1 of 5

How to remove reference to Content Libary from part?

peter.roman
Advocate
Advocate

When saving a part from a Content Library as a custom part, it retains the reference to the library family (has the option to "change size").

When the part is edited into a more unrelated variation, it still retains this reference to the original Content Library family.

0 Likes
422 Views
4 Replies
Replies (4)
Message 2 of 5

peter.roman
Advocate
Advocate

The following ilogic code removes the Content Library family reference as well as the Standard Organization info from the part.

 

The commented-out code removes authoring info, the solution to a similar problem (that this is based on): "How to remove Tube and Part Authoring from part?" 

 

 

Dim doc = ThisDoc.Document

'Remove Content Library Standard info (eg. ANSI)
oProp = doc.PropertySets.Item("32853F0F-3444-11d1-9E93-0060B03C1CA6").ItemByPropId(37)
oProp.Value=""

oProp = doc.PropertySets.Item("32853F0F-3444-11d1-9E93-0060B03C1CA6").ItemByPropId(47)
oProp.Value=""

oProp = doc.PropertySets.Item("32853F0F-3444-11d1-9E93-0060B03C1CA6").ItemByPropId(49)
oProp.Value=""

'Remove Content Library info (Family)
oProp = doc.PropertySets.Item("B9600981-DEE8-4547-8D7C-E525B3A1727A")
oProp.Delete()

'Remove Authoring info
'oProp = doc.PropertySets.Item("32853F0F-3444-11d1-9E93-0060B03C1CA6").ItemByPropId(56)
'oProp.Value=""

 

 

Use at your own risk / make a backup etc.

Maybe someone more experienced can comment if deleting

 

doc.PropertySets.Item("B9600981-DEE8-4547-8D7C-E525B3A1727A")

 

is the right way to do this?

 

How to remove Tube and Pipe Authoring information from part in Inventor 

PropertiesForDesignTrackingPropertiesEnum Enumerator 

PropertiesForContentLibraryEnum Enumerator 

 

Message 3 of 5

WCrihfield
Mentor
Mentor

Interesting post, and well documented.  Are you familiar with the PartComponentDefinition.IsContentMember property?  It is a ReadOnly Boolean, so it can not be 'set', but can be used to help determine if you have done enough to the part, so that it is no longer understood as being associated with the content center.  Also, are you aware of the other PropertySet named "ContentCenter"?  When present, I believe it only contains 1 property named "IsCustomPart", with an Integer type value (most likely zero for False, and 1 for True).  Its InternalName is "{ABDA74AD-E927-4CE3-AA83-A5F6EFCE3B75}".  If that one is present, you may be able to delete that also.  You can also look into the Document.DocumentInterests property, which returns a DocumemtInterests object.  When an Inventor add-in (ApplicationAddIn) is involved with that document somehow, there will be one of these in the document for that add-in, and you can check that using the DocumentInterests.HasInterest method, where you provide the ClientID / ClassIdString of that add-in to the method, and get a Boolean value in return.  If it contains an interest for the 'Content Center' add-in, then you may be able to remove that by using the DocumentInterests.Item property (and the same ClientID String) to get that DocumentInterest object, then use its Delete method.  Or, if the Delete method either does not work, or you don't want to go that route, its InterestType property is Read/Write, and can be set to DocumentInterestTypeEnum.kNotInterested value.  I haven't tried process this myself yet, because I have not needed to, but you can give it a try if you want and let us know if it helps any.  It may simply not be needed.  It lets the system know that there may be aspects of the document that are specific to that one add-in, and maybe what version of that add-in was used.  Once you have eliminated the part's dependency on the content center and have it fully independently defined, it should no longer be needed though.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 4 of 5

mslosar
Advisor
Advisor

I don't know what the official right way to do it is, but we have a script that i think i got from the forum a long time ago that works in 'De-cc'ing' content center file:

 

I think i modified it some, but it's been a while so i couldn't be sure.

Dim oDoc As PartDocument
oDoc = ThisApplication.ActiveDocument

' Enable all commands and set the subtype to a standard part.
oDoc.DisabledCommandTypes = 0
oDoc.SubType = "{4D29B490-49B2-11D0-93C3-7E0706000000}" 

' Optionally clean up other CC related properties.
On Error Resume Next
oDoc.PropertySets.Item("Content Library Component Properties").Delete
oDoc.PropertySets.Item("ContentCenter").Delete

Dim dtPropSet As PropertySet

dtPropSet = oDoc.PropertySets.Item("Design Tracking Properties")
dtPropSet.Item("Catalog Web Link").Value = ""
0 Likes
Message 5 of 5

peter.roman
Advocate
Advocate

I've updated the code to merge both of ours and changed the internal names I had to the descriptive names like you had (but kept the internal names / propIDs in the comments in case anyone prefers them).

The authoring removal code at the bottom is also updated with descriptive names.

 

I'm not entierly sure where the On Error Resume Next should go

 

I wasn't able to really look into the PartComponentDefinition.IsContentMember property as it looks like that needs a context but I'm only running this code inside the part file.

 

Dim oDoc = ThisDoc.Document

On Error Resume Next

'Remove Content Library Standard info (eg. ANSI)
'PropertiesForDesignTrackingPropertiesEnum 32853F0F-3444-11d1-9E93-0060B03C1CA6
oPropSet = oDoc.PropertySets.Item("Design Tracking Properties")
'kStandardDesignTrackingProperties (PropID 37)
oPropSet.Item("Standard").Value = ""
'kStandardRevisionDesignTrackingProperties (PropID 47)
oPropSet.Item("Standard Revision").Value = ""
'kStandardsOrganizationDesignTrackingProperties (PropID 49)
oPropSet.Item("Standards Organization").Value = ""
oPropSet.Item("Catalog Web Link").Value = ""

'Remove Content Library info (Family)
'PropertiesForContentLibraryEnum B9600981-DEE8-4547-8D7C-E525B3A1727A
oDoc.PropertySets.Item("Content Library Component Properties").Delete
oDoc.PropertySets.Item("ContentCenter").Delete

' Enable all commands and set the subtype to a standard part.
oDoc.DisabledCommandTypes = 0
oDoc.SubType = "{4D29B490-49B2-11D0-93C3-7E0706000000}" 

'Remove Authoring info
'PropertiesForDesignTrackingPropertiesEnum 32853F0F-3444-11d1-9E93-0060B03C1CA6
'kCategoriesDesignTrackingProperties (PropID 56)
'oPropSet = oDoc.PropertySets.Item("Design Tracking Properties")
'oPropSet.Item("Categories").Value = ""

 

 

0 Likes