Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

You might benefit from using the Option Explicit On. This line in the header will spot anything not correctly declared before you run the  code. 

 

The main issue here  is that your declaring a part document variable and setting it to be the active document which in this case is the assembly. Remove this line and use "oDoc" as the document object. 

 

				Dim oDoc1 As PartDocument = ThisApplication.ActiveDocument

 

Duplicate line here where you get the library twice bit on the second line your setting the item Variant as an object rather than an index or string value. See API help here

1.

Dim oLib As AssetLibrary =ThisApplication.AssetLibraries(oALSelect)

2.

					Dim assetLib As AssetLibrary  = ThisApplication.AssetLibraries.Item(oLib)

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan