07-01-2022
03:07 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
07-01-2022
03:07 PM
It appears that the replace reference mentioned above is not functioning and there is no documented sample to do this, so here is another approach. The manual replace all correctly keeps the reference to an imported component and the import type referenced model. So the below codes simply automates this procedure. Here is the article that references running commands.
' Get the command manager. Dim oCommandMgr As CommandManager = ThisApplication.CommandManager 'Pick occurrence Dim oAssyoOcc As ComponentOccurrence = oCommandMgr.Pick(SelectionFilterEnum.kAssemblyOccurrenceFilter, "Select Occurence") 'Select the chosen occurrence for processing oCommandMgr.DoSelect(oAssyoOcc) 'Clear the clipboard oCommandMgr.ClearPrivateEvents ' Post the filename. Call oCommandMgr.PostPrivateEvent(PrivateEventTypeEnum.kFileNameEvent,"C:\Users\Assembly5.stp") ' Get control definition for the place component command. Dim oControlDef As ControlDefinition= oCommandMgr.ControlDefinitions.Item("AssemblyReplaceAllCmd") ' Execute the command synchronously. Call oControlDef.Execute2(True)
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