• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Autodesk Inventor Customization

    Reply
    Contributor
    MDS-MQ
    Posts: 49
    Registered: ‎05-30-2011
    Accepted Solution

    View Label Information

    214 Views, 5 Replies
    06-15-2011 08:21 AM

    I was wondering if anyone has come up with a macro to gather all view label information, and possibly sheet location in a drawing. If you could share it that would be great.

     

    Thanks

    Mike

    Please use plain text.
    Distinguished Contributor
    Posts: 154
    Registered: ‎07-28-2007

    Re: View Label Information

    06-21-2011 07:27 PM in reply to: MDS-MQ

    Hi Mike, do you want to be able to select a view and get it's view label information or do you want tobe able to get every view in the entire IDW?

    Also what do you want to do with the data, Put it in a text file or just display in a message box of some sort?

     

    If you can tell me some more details on what your after i'll  post some code for you.

    Regards, Matt.

    Please use plain text.
    Contributor
    MDS-MQ
    Posts: 49
    Registered: ‎05-30-2011

    Re: View Label Information

    06-22-2011 04:58 AM in reply to: matt_jlt

    Hi Matt

     

    What I am looking for is a text or csv file of all views on all sheets of a drawing.

     

    It would be great if you could come up with something.

     

    Thanks,

    Mike

    Please use plain text.
    Contributor
    MDS-MQ
    Posts: 49
    Registered: ‎05-30-2011

    Re: View Label Information

    08-16-2011 07:11 AM in reply to: MDS-MQ

    I was woundering if there was any progress on this Macro?

    Please use plain text.
    Distinguished Contributor
    Posts: 154
    Registered: ‎07-28-2007

    Re: View Label Information

    08-16-2011 05:45 PM in reply to: MDS-MQ

    Sorry mate, i completely forgot about this thread until you replied.

     

    I just whipped up something for you. you can adjust it to suit your needs. Adjust it to suit your needs.

     

    Sub ViewLabel()
    Dim oDoc As DrawingDocument
    Set oDoc = ThisApplication.ActiveDocument

    Dim oSheet As Sheet
    Dim oView As DrawingView
    Dim oLabel As DrawingViewLabel

    Dim MyFile As String
    MyFile = "c:\" & "Info.txt"


    Open MyFile For Output As #1

    For Each oSheet In oDoc.Sheets
    For Each oView In oSheet.DrawingViews
    Set oLabel = oView.Label

    Write #1, "Label:" & oLabel.Text
    Write #1, "View X:" & oView.Position.X
    Write #1, "View Y:" & oView.Position.Y
    Write #1, " "

    Next
    Next


    Close #1
    End Sub

     

    Regards, Matt.

    Please use plain text.
    Contributor
    MDS-MQ
    Posts: 49
    Registered: ‎05-30-2011

    Re: View Label Information

    08-31-2011 09:17 AM in reply to: matt_jlt

    Hi Matt

     

    Thanks a lot for the code. With some minor tweeks we got it working great. I really appriciate it.

     

    Cheers

    Mike

    Please use plain text.