Update Browser node iLogic gives error when saving a dwg

Update Browser node iLogic gives error when saving a dwg

hanshags
Participant Participant
386 Views
5 Replies
Message 1 of 6

Update Browser node iLogic gives error when saving a dwg

hanshags
Participant
Participant

Hi All,

 

I have a script for updating browsernodes in ipt and iam that I found as such:

 

Sub Main()
    Dim oDoc As Document = ThisApplication.ActiveDocument
    oDoc.DisplayName = ""
    Dim oCD As ComponentDefinition = oDoc.ComponentDefinition
    NameReset(oCD.Occurrences)
End Sub

Sub NameReset(oOccs As ComponentOccurrences)
    For Each oOcc As ComponentOccurrence In oOccs
        Try
            oOcc.Name = ""
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
        Try
            NameReset(oOcc.SubOccurrences)
        Catch
        End Try
    Next
End Sub

 

It works well for both ipt and iam.

But now when I try to save the drawing (with either ipt or iam), I get the following error:

Error in rule: UpdateBrowserNodes, in document: DOC1234 - Plate with 4x holes.ipt

Member not found. (Exception from HRESULT: 0x80020003 (DISP_E_MEMBERNOTFOUND))

 

Is there another way to do this? Fix error so it doesn't run the iLogic in dwg from ipt/iam rule (that gives the error in dwg)?

Hope you can help 😉

0 Likes
387 Views
5 Replies
Replies (5)
Message 2 of 6

bradeneuropeArthur
Mentor
Mentor
the active document is at that moment the drawing and not the ipt file I assume.

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 3 of 6

hanshags
Participant
Participant

Yes, that is correct 😉

 

So, is there a way to not run the "updatebrowsernodes" iLogic, once I save the drawings?

The script works really well inside both ipt and iam - but again, I get this error in dwg.

 

Any help in the right direction would be greatly appreciated - thanks.

0 Likes
Message 4 of 6

hanshags
Participant
Participant

I tried some other scripts - but all seems to give errors, when part/assembly is placed inside dwg.

Maybe some other suggestions how to have iLogic to just update once (ie. trigger before save?) in the assemblies, but then won't trigger in the drawings?

 

Maybe some suggestions?

 

🤔

0 Likes
Message 5 of 6

hanshags
Participant
Participant

Any solution to this?

0 Likes
Message 6 of 6

WCrihfield
Mentor
Mentor

Hi @hanshags.  I believe that all you need is a simple additional line of code included near the beginning of your Sub Main block of code that checks the document's Type.  Like the following line:

If oDoc.DocumentType = DocumentTypeEnum.kDrawingDocumentObject Then Exit Sub

Insert that line of code just under your existing line of code which sets the value of the 'oDoc' variable to the active document.  That line checks to see if it is a drawing, and if so, it will exit the rule, without doing anything else.

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes