Change the Derive Style of a derived assembly in VBA

Change the Derive Style of a derived assembly in VBA

shastu
Advisor Advisor
609件の閲覧回数
2件の返信
メッセージ1/3

Change the Derive Style of a derived assembly in VBA

shastu
Advisor
Advisor

I have code to create a derived assembly based off of the active file.  All I need is a way to change the Derive Style but can't seem to figure it out.  I have included a screenshot of what I am trying to accomplish only I need to be able to do it through the API.

0 件のいいね
解決済み
610件の閲覧回数
2件の返信
返信 (2)
メッセージ2/3

HideoYamada
Advisor
Advisor
解決済み

Hello shastu,

 

Set DerivedAssemblyDefinition.DeriveStyle Property.

 

Function CreateDerivedAssy(FullFileName As String) As DerivedAssemblyComponent
    Dim oPartDoc As PartDocument: Set oPartDoc = ThisApplication.ActiveDocument
    Dim oPartDef As PartComponentDefinition: Set oPartDef = oPartDoc.ComponentDefinition
    Dim oDerivedAssys As DerivedAssemblyComponents: Set oDerivedAssys = oPartDef.ReferenceComponents.DerivedAssemblyComponents
    Dim oDerivedDef As DerivedAssemblyDefinition: Set oDerivedDef = oDerivedAssys.CreateDefinition(FullFileName)
    
    ' This changes Derive Style!
    oDerivedDef.DeriveStyle = kDeriveAsSingleBodyWithSeams
    
    Set CreateDerivedAssy = oDerivedAssys.Add(oDerivedDef)
End Function

 

=====

Freeradical

 Hideo Yamada

=====
Freeradical
 Hideo Yamada
https://www.freeradical.jp
0 件のいいね
メッセージ3/3

shastu
Advisor
Advisor

Thank you so much!!!  I didn't realize that I had to do it within a function.  I was trying to get it accomplished within my sub.

0 件のいいね