open drawing deferred vba ignore ilogic form error log print close next

open drawing deferred vba ignore ilogic form error log print close next

andrew_canfield
Collaborator Collaborator
571 Views
4 Replies
Message 1 of 5

open drawing deferred vba ignore ilogic form error log print close next

andrew_canfield
Collaborator
Collaborator

I've found some code to open a drawing using VBA & it works 🙂

I'd like to open with deferred updates on.

But some drawings have embedded code (before my time) & an ilogic rule checks iproperties  - i'd like to skip the code to just print the drawing. 

on error log the drawing number & close. (some fea files are causing resolution issues)

no error then print (the default printer will be set to pdf)

close

goto the next file in the list (or selected - possibly over complicating at this stage)

 

Basically this is to batch print as pdf but dialogue boxes keep interrupting 

 

 

open.JPG

 

below is the iLogic form which needs closing.

iLogic formiLogic form

 

Regards

 

Andrew

0 Likes
572 Views
4 Replies
Replies (4)
Message 2 of 5

chandra.shekar.g
Autodesk Support
Autodesk Support

@andrew_canfield,

 

All iLogic triggers can be disabled manually as shown in below image. After disabling iLogic trigger, VBA code can be used to print all drawings to PDF. Later, event triggers should be enabled to trigger iLogic rules.

image (1).png

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 3 of 5

andrew_canfield
Collaborator
Collaborator

Thankyou.

 

Any pointers on skipping file resolutions (fea files in particular) ?

 

Not sure how to create a batch either...

 

Andrew

0 Likes
Message 4 of 5

chandra.shekar.g
Autodesk Support
Autodesk Support

@andrew_canfield,

 

Hoping that below VBA code may be helpful to print all drawing files.

Public Sub ListESY()
    Const strFolder As String = "C:\Temp\"
    Const strPattern As String = "*.dwg"
    Dim strFile As String
    Dim oDoc As DrawingDocument
    strFile = Dir(strFolder & strPattern, vbNormal)
    Do While Len(strFile) > 0
        Debug.Print strFile '<- view this in Immediate window; Ctrl+g will take you there
        Set oDoc = ThisApplication.Documents.Open(strFolder & strFile, True)
        'Code to Print PDF
    Loop
End Sub

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 5 of 5

andrew_canfield
Collaborator
Collaborator

unfortunately the folder is huge!

i'd like to cherry pick which drawings are needed & add them to a print queue.

Investigating further - thankyou

0 Likes