Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Export each views to pdf or png

Anonymous

Export each views to pdf or png

Anonymous
Not applicable

Hi,

I'm looking to automatically extract wired views (front, side, top, ISO) where 1 view = 1 file (.pdf/.eps or.png).
These images will be used for technical sheet automatically generated with Adobe Indesign.

Currently, I manually make a drawing that I export to PDF, and extract the views with Adobe Illustrator.

 

Thank you in advance

0 Likes
Reply
Accepted solutions (1)
843 Views
2 Replies
Replies (2)

HermJan.Otterman
Advisor
Advisor
Accepted solution

Hello Antoine,

 

it took me some time but here is som code ...

put it in a iLogic rule and run it in a drawing.

on c:\temp\ will PNG. 's be created...

 

SyntaxEditor Code Snippet

Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument
        Dim oDrawView As DrawingView
        
        Dim oSheet As Sheet
        Dim cam As Camera
        cam = ThisApplication.ActiveView.Camera

        Dim tg As TransientGeometry
        tg = ThisApplication.TransientGeometry

        Dim i As Integer = 0

        For Each oSheet In oDrawDoc.Sheets
            oSheet.Activate()
            For Each oDrawView In oSheet.DrawingViews
                i = i + 1
                cam.Eye = tg.CreatePoint(oDrawView.Center.X, oDrawView.Center.Y, 20)
                cam.Target = tg.CreatePoint(oDrawView.Center.X, oDrawView.Center.Y, 10)
                cam.UpVector = tg.CreateUnitVector(0, 1, 0)
                cam.SetExtents(oDrawView.Width + 1, oDrawView.Height + 1)

                cam.ApplyWithoutTransition()

                ThisApplication.ActiveView.Camera.SaveAsBitmap("C:\temp\picture" & i & ".png", (oDrawView.Width + 1) * 100, (oDrawView.Height + 1) * 100)

            Next
        Next
If this answers your question then please select "Accept as Solution"
Kudo's are also appreciated Smiley Wink

Succes on your project, and have a nice day

Herm Jan


Anonymous
Not applicable

Great ! Thank you very much.

It will be so much faster like this.

0 Likes