Determine if SubAssembly was created with Design Assistant

Determine if SubAssembly was created with Design Assistant

Maxim-CADman77
Advisor Advisor
737 Views
10 Replies
Message 1 of 11

Determine if SubAssembly was created with Design Assistant

Maxim-CADman77
Advisor
Advisor

I wonder how can I determine if subassembly was created with Design Assistant.

AFAIK subassembly created with Cable&Harness has "HarnessAssembly" as DocumentInterest.Name 

When I read this value for spring subassembly created with Design Assistant I get "ClientObjectVersion". I found no references to this value in API help ... if it what I'm looking for?

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
738 Views
10 Replies
Replies (10)
Message 2 of 11

chandra.shekar.g
Autodesk Support
Autodesk Support

@Maxim-CADman77,

 

Unfortunately, Inventor API does not support for Design Assistant. Please log this wish list at idea station using below link.

 

https://forums.autodesk.com/t5/inventor-ideas/idb-p/v1232

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 3 of 11

Maxim-CADman77
Advisor
Advisor

What "ClientObjectVersion" means (i don't see it in the API)?

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 4 of 11

chandra.shekar.g
Autodesk Support
Autodesk Support

@Maxim-CADman77,

 

Can you please provide reproducible steps, source code and dataset to investigate? please make sure that files are non confidential.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 5 of 11

LukeDavenport
Collaborator
Collaborator

Hi @MaximUdod

From your description it sounds as if you want to identify whether a sub assembly was created with a design accelerator (such as the spring generator in the 'Design' tab) not Design Assistant (which is a simple file management system for Inventor).

 

This might help Chandra to assist you,

Luke

0 Likes
Message 6 of 11

Maxim-CADman77
Advisor
Advisor

You are right - there is a mistake in the name of Inventor Component in the initial Description of the issue (and thread subject).Thank you for noting that.

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 7 of 11

Maxim-CADman77
Advisor
Advisor

 Is it possible by means of Inventor API determine that SubAssembly was created with Design ACCELERATOR (not Assistant)?

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 8 of 11

chandra.shekar.g
Autodesk Support
Autodesk Support

@Maxim-CADman77,

 

Unfortunately, Inventor API does not support Design Accelerator. Please log this wish list at idea station using below link.

 

https://forums.autodesk.com/t5/inventor-ideas/idb-p/v1232

 

Thanks and regards,

 


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 9 of 11

LukeDavenport
Collaborator
Collaborator

It is possible.

 

See this Autodesk article - you need to use the 'HasInterest' method.

 

https://adndevblog.typepad.com/manufacturing/2012/08/identify-parts-created-by-frame-generator-with-...

 

Here's a more general purpose function I used a while ago. I haven't tested it recently though. Let me know if it helps.

Luke

 

    Function CheckDesignAccDocTypes(ByVal oDoc As Document) As Boolean

 

        Dim oTypeList As New List(Of String)

        oTypeList.Add("Piping Runs Environment")

        oTypeList.Add("Piping Run Environment")

        oTypeList.Add("Piping Route Environment")

        oTypeList.Add("Piping Hose Environment")

 

        oTypeList.Add("HarnessPart")

        oTypeList.Add("HarnessAssembly")

        oTypeList.Add("NailboardDrawing")

 

        oTypeList.Add("SkeletonDoc")

        TypeList.Add("FrameMemberDoc")

        oTypeList.Add("FrameDoc")

 

        For Each S As String In oTypeList

            If oDoc.DocumentInterests.HasInterest(S) Then

                Return True

            End If

        Next

 

        Return False

 

    End Function

0 Likes
Message 10 of 11

Maxim-CADman77
Advisor
Advisor

Thank you. Your function returned false on the sample attached.
I guess for ny needs function should be like this:

Function CheckDesignAccDocTypes(ByVal oDoc As Document) As Boolean

If oDoc.DocumentInterests.HasInterest("ClientObjectVersion") Then
Return True
End if
Return False

End Function

Have I understand you correctly?

 

PS: 

Supposedly for Design Accelerator:

  DocumentInterest.Name = "ClientObjectVersion"

  Document.Interest.ClientID = "BB8FE430-83BF-418D-8DF9-9B323D3DB9B9"

 

PPS:

There is a thread referencing some ClientIDs strting from this message - 
https://forums.autodesk.com/t5/inventor-customization/ilogic-save-assembly-copy-amp-replace-specifie...

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 11 of 11

dba78
Advocate
Advocate

I think, your Code should check for the ClientId instead of the name

 

...HasInterest("{BB8FE430-83BF-418D-8DF9-9B323D3DB9B9}")  , which is the clientId of the Design Accelerator Addin. The Interest.Name could vary by type of the accelerator used (not tested... just an assumption)

 

As for finding out, which accelerator was used, there is an Attributeset "FDesign" on the ComponentOccurrence Object in the hosting assembly. This Contains an Attibute Named: "Data". This contains some XML-Fomatted Info about the creator. Not checked yet, but I guess, this info will be present for all DA-created Components. I guess the Class Names and/or clientId-s may map to the definitions in the DA-Xmls (Desing Data Directory)

HTH,

Daniel

 

0 Likes