<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: dwg sheet size in custom model iprop in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/dwg-sheet-size-in-custom-model-iprop/m-p/5642524#M118540</link>
    <description>&lt;P&gt;What version did you do this in because when i ran it using ilogic in inventor 2015 it results in errors.&lt;/P&gt;&lt;P&gt;1) 'Let' and 'set' assignment statements are no longer supported&lt;/P&gt;&lt;P&gt;2) oTextBoxes is not declared. It may be inaccessible due to its protection level&lt;/P&gt;&lt;P&gt;3) oTitleblock&amp;nbsp;&lt;SPAN&gt;is not declared. It may be inaccessible due to its protection level&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also i did manage to get the previous vba to run and found the sheet text block to be #29&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I dont no was i clear on what i wanted to achieve. Or i may be understanding you wrong. This method you suggest does it display the sheet size in a promt like box in the drawing?&amp;nbsp;If so it wouldnt be of any use displaying the size has its already on the sheet. I want to have it send/transfer that sheet size value to a custom iproperty in the model that 'would be' in the drawing.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 19 May 2015 21:38:42 GMT</pubDate>
    <dc:creator>JamieSENG</dc:creator>
    <dc:date>2015-05-19T21:38:42Z</dc:date>
    <item>
      <title>dwg sheet size in custom model iprop</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/dwg-sheet-size-in-custom-model-iprop/m-p/5628947#M118536</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ive been searching for a way to have the sheet property "sheet size" in are dwg title block transfer on saving to a custom property in the model under "paper size".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is so when it comes to printing drawings we can identify what size and which printer to use.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ive hit a brick wall in my attempts of writting an ilogic code to do this so im putting out there to anyone who&amp;nbsp;may know.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We use one dwg template and title block which when its required we edit sheet and select the paper size needed. That size we select updates in the title block. When i edit the title block the options i have in sheet properties are sheet number, revision and size.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Look forward to your replies...&lt;/P&gt;</description>
      <pubDate>Sun, 10 May 2015 20:19:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/dwg-sheet-size-in-custom-model-iprop/m-p/5628947#M118536</guid>
      <dc:creator>JamieSENG</dc:creator>
      <dc:date>2015-05-10T20:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: dwg sheet size in custom model iprop</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/dwg-sheet-size-in-custom-model-iprop/m-p/5633533#M118537</link>
      <description>&lt;P&gt;All texts in the TitleBlock object are stored in the TextBox objects.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN style="line-height: 15px;"&gt;TitleBlock.Definition property &amp;nbsp;-&amp;gt;&amp;nbsp; TitleBlockDefinition object&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN style="line-height: 15px;"&gt;TitleBlockDefinition.Sketch property&amp;nbsp; -&amp;gt;&amp;nbsp; DrawingSketch object&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN style="line-height: 15px;"&gt;DrawingSketch.TextBoxes Property&amp;nbsp; -&amp;gt;&amp;nbsp; TextBoxes collection&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;The TextBoxes collection provides access to all the existing TextBox objects in this Sketch.&lt;SPAN style="line-height: 15px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Here is the VBA snippet that prints texts stored in all TextBoxes in the current TitleBlock&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;Sub TextBoxesInTitleBlock()

    Dim oDrawDoc As DrawingDocument
    Set oDrawDoc = ThisApplication.ActiveDocument
    
    Dim oSheet As Sheet
    Set oSheet = oDrawDoc.ActiveSheet
    
    Dim oTitleBlock As TitleBlock
    Set oTitleBlock = oSheet.TitleBlock
    
    ' Obtain a reference to the title block defintion.
    Dim oDef As TitleBlockDefinition
    Set oDef = oTitleBlock.Definition
    
    Dim oSketch As DrawingSketch
    Set oSketch = oDef.sketch

    Dim oTextBoxes As TextBoxes
    Set oTextBoxes = oSketch.TextBoxes
    
    Debug.Print "Total number: " &amp;amp; oTextBoxes.Count
    Debug.Print "Content: "
    Dim i As Integer
    Dim St As String
    Dim oBox As TextBox
    For i = 1 To oTextBoxes.Count
        Set oBox = oTextBoxes.Item(i)
        St = oBox.Text
''        St = oBox.FormattedText
        Debug.Print i, St
    Next i

End Sub&lt;/PRE&gt;
&lt;P&gt;Here is the result I got with the newly created drawing sheet:&lt;/P&gt;
&lt;PRE&gt;Total number: 19
Content: 
 1            &amp;lt;Sheet number&amp;gt;
 2            &amp;lt;Sheet Size&amp;gt;
 3            &amp;lt;TITLE&amp;gt;
 4            &amp;lt;PART NUMBER&amp;gt;
 5            State
 6            Changes
 7            Date
 8            Name
 9            Drawn
 10           Checked
 11           Standard
 12           Date
 13           Name
 14           &amp;lt;CREATION DATE&amp;gt;
 15           &amp;lt;CHECKED DATE&amp;gt;
 16           &amp;lt;ENG APPROVAL DATE&amp;gt;
 17           &amp;lt;AUTHOR&amp;gt;
 18           &amp;lt;ENG APPROVED BY&amp;gt;
 19           &amp;lt;CHECKED BY&amp;gt;&lt;/PRE&gt;
&lt;P&gt;The Sheet size in my title block is stored in the box #2.&lt;BR /&gt;So we&amp;nbsp;may save it’s text in the custom iProperty:&lt;BR /&gt;&lt;FONT face="lucida sans unicode,lucida sans"&gt;iProperties.Value("Custom", "Sheet Size") = oTextBoxes.Item(2).Text&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this could help you to develop the iLogic rule that suits your needs.&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2015 18:09:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/dwg-sheet-size-in-custom-model-iprop/m-p/5633533#M118537</guid>
      <dc:creator>Vladimir.Ananyev</dc:creator>
      <dc:date>2015-05-13T18:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: dwg sheet size in custom model iprop</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/dwg-sheet-size-in-custom-model-iprop/m-p/5636064#M118538</link>
      <description>&lt;P&gt;Can you elabarate? I ran it but it did nothing..&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2015 21:50:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/dwg-sheet-size-in-custom-model-iprop/m-p/5636064#M118538</guid>
      <dc:creator>JamieSENG</dc:creator>
      <dc:date>2015-05-14T21:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: dwg sheet size in custom model iprop</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/dwg-sheet-size-in-custom-model-iprop/m-p/5641331#M118539</link>
      <description>&lt;P&gt;I’ve got the following text boxes list for your template:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;Total number: 30
Content: 
 1            PROJECT:
 2            TITLE:
 3            DRAWINGNUMBER:
 4            REV:
 5            &amp;lt;PROJECT&amp;gt;
 6            &amp;lt;REVISION NUMBER&amp;gt;
 7            MATERIAL:
 8            FINISH:
 9            &amp;lt;DESCRIPTION&amp;gt;
 10           &amp;lt;Finish&amp;gt;
 11           SCALE:
 12           &amp;lt;Scale&amp;gt;
 13           SIZE:
 14           Test Company
 15           ENGLAND.
 16           TEL: FAX:
 17           DRAWN BY:
 18           &amp;lt;AUTHOR&amp;gt;
 19           CREATED:
 20           &amp;lt;CREATION DATE&amp;gt;
 21           THIRD ANGLE PROJECTION
 22           MACHININGUP TO 100 ±0.15101 TO 300 ±0.40301 TO 1000 ±0.80MACHINED SURFACE FINISH 3.2um
 23           FABRICATIONUP TO 300 ±1.0301 TO 1000 ±2.01000 &amp;amp; ABOVE ±3.0
 24           TOLERANCES U.O.S.
 25           DO NOT SCALE DRAWING
 26           ALL DIMENSIONS IN mm U.O.S.
 27           THIS DRAWING SHOULD NOT BE COPIEDOR PASSED TO A THIRD PARTYWITHOUT THE WRITTEN CONSENT.
 28           &amp;lt;PART NUMBER&amp;gt;
 29           &amp;lt;Sheet Size&amp;gt;
 30           &amp;lt;TITLE&amp;gt;
LE PROJECTION
 22           MACHININGUP TO 100 ±0.15101 TO 300 ±0.40301 TO 1000 ±0.80MACHINED SURFACE FINISH 3.2um
 23           FABRICATIONUP TO 300 ±1.0301 TO 1000 ±2.01000 &amp;amp; ABOVE ±3.0
 24           TOLERANCES U.O.S.
 25           DO NOT SCALE DRAWING
 26           ALL DIMENSIONS IN mm U.O.S.
 27           THIS DRAWING SHOULD NOT BE COPIEDOR PASSED TO A THIRD PARTYWITHOUT THE WRITTEN CONSENT.
 28           &amp;lt;PART NUMBER&amp;gt;
 29           &amp;lt;Sheet Size&amp;gt;
 30           &amp;lt;TITLE&amp;gt;&lt;/PRE&gt;
&lt;P&gt;The field “&amp;lt;Sheet Size&amp;gt;” is stored in the text box #29.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now we may use the method TitleBlock.GetResultText(TextBox) to get the text that is currently displayed for this text box with prompted text.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;Set oBox = oTextBoxes.Item(29)
St = oTitleBlock.GetResultText(oBox)
MsgBox (St)&lt;/PRE&gt;
&lt;P&gt;St returns the sheet size “A3”.&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2015 09:25:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/dwg-sheet-size-in-custom-model-iprop/m-p/5641331#M118539</guid>
      <dc:creator>Vladimir.Ananyev</dc:creator>
      <dc:date>2015-05-19T09:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: dwg sheet size in custom model iprop</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/dwg-sheet-size-in-custom-model-iprop/m-p/5642524#M118540</link>
      <description>&lt;P&gt;What version did you do this in because when i ran it using ilogic in inventor 2015 it results in errors.&lt;/P&gt;&lt;P&gt;1) 'Let' and 'set' assignment statements are no longer supported&lt;/P&gt;&lt;P&gt;2) oTextBoxes is not declared. It may be inaccessible due to its protection level&lt;/P&gt;&lt;P&gt;3) oTitleblock&amp;nbsp;&lt;SPAN&gt;is not declared. It may be inaccessible due to its protection level&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also i did manage to get the previous vba to run and found the sheet text block to be #29&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I dont no was i clear on what i wanted to achieve. Or i may be understanding you wrong. This method you suggest does it display the sheet size in a promt like box in the drawing?&amp;nbsp;If so it wouldnt be of any use displaying the size has its already on the sheet. I want to have it send/transfer that sheet size value to a custom iproperty in the model that 'would be' in the drawing.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2015 21:38:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/dwg-sheet-size-in-custom-model-iprop/m-p/5642524#M118540</guid>
      <dc:creator>JamieSENG</dc:creator>
      <dc:date>2015-05-19T21:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: dwg sheet size in custom model iprop</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/dwg-sheet-size-in-custom-model-iprop/m-p/5642939#M118541</link>
      <description>&lt;P&gt;That was&amp;nbsp;VBA code, not iLogic.&amp;nbsp; This explains why you got those errors in iLogic ('Let' and 'set', and so on).&lt;/P&gt;
&lt;P&gt;If you already got the sheet size somehow and want to save it in the custom iProperty, you may use iLogic function&lt;/P&gt;
&lt;P&gt;iProperties.Value("Custom", "Paper size") = size&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the iLogic snippet:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;'reads sheet size from the Title Block
'and saves it in the custom iProperty

'active sheet
Dim oSheet As Sheet = ActiveSheet.Sheet
'reference to the existing title block
Dim oTitleBlock As TitleBlock = oSheet.TitleBlock
' Obtain a reference to the title block defintion.
Dim oDef As TitleBlockDefinition = oTitleBlock.Definition
'this sketch contains the collection of all text boxes of the title block
Dim oSketch As DrawingSketch = oDef.Sketch
'reference to the text box that stores Sheet Size string
'in this template it is the 29th text box in the collection
Dim oBox As TextBox = oSketch.TextBoxes.Item(29)
'read the sheet size
Dim size As String  = oTitleBlock.GetResultText(oBox)
'save data in the custom iProperty
iProperties.Value("Custom", "Paper size") = size

'this message is for debug purpose only
MsgBox("Paper size saved:   " &amp;amp; size)&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN style="line-height: 15px;"&gt;cheers,&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2015 08:15:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/dwg-sheet-size-in-custom-model-iprop/m-p/5642939#M118541</guid>
      <dc:creator>Vladimir.Ananyev</dc:creator>
      <dc:date>2015-05-20T08:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: dwg sheet size in custom model iprop</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/dwg-sheet-size-in-custom-model-iprop/m-p/5645410#M118542</link>
      <description>&lt;P&gt;I think you may still have got the wrong idea of what i was trying to achieve. I have however finally been able to find a&amp;nbsp;solution using what you did.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Take note of custom iproperties in the .ipt... Insert the part into the drawing and run the code, check .ipt properties again.... there appears the sheet size. Ill now use a custom property in the bill of materials so this value for each part appears. This will go nicely&amp;nbsp;in identifying&amp;nbsp;what printing settings&amp;nbsp;i should use. You see i'm&amp;nbsp;using inventor task scheduler, sequential task to batch print so i tend to be setting up a A1,2 and 3 batch of drawings which up to now I've&amp;nbsp;had to do separately&amp;nbsp;has guesstimating&amp;nbsp;has been judged by looking at the tiny little thumbnail preview.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Anyway Id appreciate&amp;nbsp;your feedback if you wouldn't&amp;nbsp;mind.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also I did read&amp;nbsp;another person asking about this with no look up to now so i hope that this will be of use to them or anyone for that matter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you Vladimir&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2015 21:07:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/dwg-sheet-size-in-custom-model-iprop/m-p/5645410#M118542</guid>
      <dc:creator>JamieSENG</dc:creator>
      <dc:date>2015-05-20T21:07:12Z</dc:date>
    </item>
  </channel>
</rss>

