Hi Jane;
It is a good code.
I revised it as follows.
I have the full document name copied in the clip board as a result of running another code. It works. My only concern is I need the Derived Part dialog box remains open so that I can turn on the required variables or work features.
Could you fix it, please. Thanks.
Imports System.Windows.Forms
Sub main()
Dim oPD As PartComponentDefinition
oPD = ThisDoc.Document.ComponentDefinition
Dim DD As DerivedPartDefinition
'DD = oPD.ReferenceComponents.DerivedPartComponents.CreateUniformScaleDef("Full path of derived part")
oDoc_Source = Clipboard.GetText()
DD = oPD.ReferenceComponents.DerivedPartComponents.CreateUniformScaleDef(oDoc_Source)
DD.ExcludeAll()
DD.UseColorOverridesFromSource = fasle
Dim oPDC As DerivedPartComponent
oPDC = oPD.ReferenceComponents.DerivedPartComponents.Add(DD)
End Sub