08-09-2023
07:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
08-09-2023
07:37 AM
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
Or if this helped you, please, click (like)
Regards
Alan