<?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: To Change Drawing View Scale Formatting (/ to : or vice versa) in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/to-change-drawing-view-scale-formatting-to-or-vice-versa/m-p/9524567#M110974</link>
    <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2129088"&gt;@RoyWickrama_RWEI&lt;/a&gt;.&amp;nbsp; Not sure if you ever figured out how to do your final request here or not, but here's a tip to help you figure out how to write the FormattedText portion of the code.&amp;nbsp; The FormattedText uses XML programming language within, so it's a bit tricky.&amp;nbsp; If you're not a pro at writing and understatding XML, usually the best to get your String formatted the way you want it is to use something like a MessageBox.Show(), MsgBox(), or InputBox().&lt;/P&gt;&lt;P&gt;Create the View label the way you want it manually on the drawing, then access it by code and show the oView.Label.FormattedText in one of those messages to youself.&amp;nbsp; That will show you exactly how it is formatted "behind the scene".&amp;nbsp; If you use either InputBox() or InputListBox() you will be able to select and copy the resulting string.&lt;/P&gt;</description>
    <pubDate>Mon, 18 May 2020 18:17:37 GMT</pubDate>
    <dc:creator>WCrihfield</dc:creator>
    <dc:date>2020-05-18T18:17:37Z</dc:date>
    <item>
      <title>To Change Drawing View Scale Formatting (/ to : or vice versa)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/to-change-drawing-view-scale-formatting-to-or-vice-versa/m-p/9133474#M102895</link>
      <description>&lt;P&gt;I need changing the view scale format: just to change : to / or vice versa while existing scale remains the same.&lt;/P&gt;&lt;P&gt;Could someone help me.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2019-11-07 07_51_11-Window.png" style="width: 572px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/695635i4CEA7B9BCE16CA33/image-size/large?v=v2&amp;amp;px=999" role="button" title="2019-11-07 07_51_11-Window.png" alt="2019-11-07 07_51_11-Window.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2019-11-07 07_53_04-Window.png" style="width: 458px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/695636i68C5F013844CF906/image-size/large?v=v2&amp;amp;px=999" role="button" title="2019-11-07 07_53_04-Window.png" alt="2019-11-07 07_53_04-Window.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;'https://forums.autodesk.com/t5/inventor-customization/ilogic-code-to-change-view-label-text/td-p/3625130
'https://forums.autodesk.com/t5/inventor-customization/exsisting-ilogic-rule-view-label-fitted-with-item-number/td-p/6323006

oModelDoc = IO.Path.GetFileName(ThisDrawing.ModelDocument.FullFileName)


Dim oSSet As SelectSet = ThisDoc.Document.SelectSet
If oSSet.Count = 0 Then
	MessageBox.Show("SELECT A DRAWING VIEW FIRST!", "INSTRUCTIONS")
Exit Sub
End If
			
			
Dim oView_Names As New ArrayList
oView_Names.Add("DESN - PN")
oView_Names.Add("DESN - VL")


oView_Selected = InputListBox("Prompt", oView_Names, oView_Names(0), Title := "Title", ListName := "List")

'Reference to the drawing view from the 1st selected object
Dim oView As DrawingView = TryCast(oSSet.Item(1), DrawingView)
If oView IsNot Nothing Then
	oView.ShowLabel = True
	If oView_Selected = "DESN - PN" Then
		'format the model iproperties	
		oDescription = "&amp;lt;StyleOverride Underline='True'&amp;gt;&amp;lt;Property Document='model' PropertySet='Design Tracking Properties' Property='Description' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='29'&amp;gt;DESCRIPTION&amp;lt;/Property&amp;gt;&amp;lt;/StyleOverride&amp;gt;"
		oPartNumber = "&amp;lt;StyleOverride Underline='True'&amp;gt; - &amp;lt;Property Document='model' PropertySet='Design Tracking Properties' Property='Part Number' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='5'&amp;gt;PART NUMBER&amp;lt;/Property&amp;gt;&amp;lt;/StyleOverride&amp;gt;"
		'oStringMass = "&amp;lt;Br/&amp;gt;&amp;lt;StyleOverride Underline='False' FontSize='0.35'&amp;gt;EST UNIT MASS = &amp;lt;PhysicalProperty PhysicalPropertyID='72449' Precision='2'&amp;gt;MASS&amp;lt;/PhysicalProperty&amp;gt;&amp;lt;/StyleOverride&amp;gt;"
		oStringScale = "&amp;lt;Br/&amp;gt;&amp;lt;StyleOverride FontSize='0.3'&amp;gt;(SCALE: &amp;lt;DrawingViewScale/&amp;gt;)&amp;lt;/StyleOverride&amp;gt;"
		'add to the view label
		oView.Label.FormattedText = oDescription &amp;amp; oPartNumber &amp;amp; oStringMass &amp;amp; oStringScale	
	Else If oView_Selected = "DESN - VL" Then
		
		Dim DESN_VLs As New ArrayList
		DESN_VLs.Add(iProperties.Value(oModelDoc, "Custom", "DESN_VL"))
		DESN_VLs.Add("HSS")
		DESN_VLs.Add("BEAM WELDMENT")
		DESN_VLs.Add("BRACING WELDMENT")
		DESN_VLs.Add("PLATE")
		DESN_VLs.Add("ANGLE")
		DESN_VL_Selected = InputListBox("Prompt", DESN_VLs, DESN_VLs(0), Title := "DESCRIPTION for VL", ListName := "Select")
		DESN_VL_EDIT = InputBox("EDIT/ACCEPT DESN_VL ", "Title", DESN_VL_Selected)
		iProperties.Value(oModelDoc, "Custom", "DESN_VL") = DESN_VL_EDIT
			
			oView_Selected_New = InputBox("EDIT/ACCEPT CUSTOM TEXT: ", "TYPE TEXT TO SUIT", DESN_VL_EDIT)
			'format the text first line
			oStringItem = "&amp;lt;StyleOverride Underline='True'&amp;gt;" &amp;amp; oView_Selected_New &amp;amp; "&amp;lt;/StyleOverride&amp;gt;"

			'oDescription = "&amp;lt;StyleOverride Underline='True'&amp;gt;&amp;lt;Property Document='model' PropertySet='Design Tracking Properties' Property='Description' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='29'&amp;gt;DESCRIPTION&amp;lt;/Property&amp;gt;&amp;lt;/StyleOverride&amp;gt;"
			oPartNumber = "&amp;lt;StyleOverride Underline='True'&amp;gt; - &amp;lt;Property Document='model' PropertySet='Design Tracking Properties' Property='Part Number' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='5'&amp;gt;PART NUMBER&amp;lt;/Property&amp;gt;&amp;lt;/StyleOverride&amp;gt;"
			'oStringMass = "&amp;lt;Br/&amp;gt;&amp;lt;StyleOverride Underline='False' FontSize='0.35'&amp;gt;EST UNIT MASS = &amp;lt;PhysicalProperty PhysicalPropertyID='72449' Precision='2'&amp;gt;MASS&amp;lt;/PhysicalProperty&amp;gt;&amp;lt;/StyleOverride&amp;gt;"
			oStringScale = "&amp;lt;Br/&amp;gt;&amp;lt;StyleOverride FontSize='0.3'&amp;gt;(SCALE: &amp;lt;DrawingViewScale/&amp;gt;)&amp;lt;/StyleOverride&amp;gt;"
			'add to the view label
			oView.Label.FormattedText = oStringItem &amp;amp; oPartNumber &amp;amp; oStringScale	
	End If
Else
	MessageBox.Show("The selected object is not a drawing view", "iLogic")
End If



'Dim oApp As Application: oApp = ThisApplication
'Dim oDoc As DrawingDocument: oDoc = oApp.ActiveDocument

Dim oSheets As Sheets
Dim oSheet As Sheet
Dim oViews As DrawingViews
'Dim oView As DrawingView

&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 15:54:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/to-change-drawing-view-scale-formatting-to-or-vice-versa/m-p/9133474#M102895</guid>
      <dc:creator>RoyWickrama_RWEI</dc:creator>
      <dc:date>2019-11-07T15:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: To Change Drawing View Scale Formatting (/ to : or vice versa)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/to-change-drawing-view-scale-formatting-to-or-vice-versa/m-p/9137144#M102952</link>
      <description>&lt;P&gt;Hi, to change the character that is used on the scale, you could use an ilogic rule like the following&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;doc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingDocument&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oScale&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt;

&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oSheet&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Sheet&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;doc&lt;/SPAN&gt;.&lt;SPAN&gt;Sheets&lt;/SPAN&gt;
	&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oView&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingView&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN&gt;DrawingViews&lt;/SPAN&gt;
		&lt;SPAN&gt;oScale&lt;/SPAN&gt; = &lt;SPAN&gt;oView&lt;/SPAN&gt;.&lt;SPAN&gt;ScaleString&lt;/SPAN&gt;
		&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;InStr&lt;/SPAN&gt;(&lt;SPAN&gt;oScale&lt;/SPAN&gt;, &lt;SPAN&gt;":"&lt;/SPAN&gt;) &amp;lt;&amp;gt; 0 &lt;SPAN&gt;Then&lt;/SPAN&gt; &lt;SPAN&gt;oView&lt;/SPAN&gt;.&lt;SPAN&gt;ScaleString&lt;/SPAN&gt; = &lt;SPAN&gt;oScale&lt;/SPAN&gt;.&lt;SPAN&gt;Replace&lt;/SPAN&gt;(&lt;SPAN&gt;":"&lt;/SPAN&gt;,&lt;SPAN&gt;"/"&lt;/SPAN&gt;)
		&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;InStr&lt;/SPAN&gt;(&lt;SPAN&gt;oScale&lt;/SPAN&gt;, &lt;SPAN&gt;"/"&lt;/SPAN&gt;) &amp;lt;&amp;gt; 0 &lt;SPAN&gt;Then&lt;/SPAN&gt; &lt;SPAN&gt;oView&lt;/SPAN&gt;.&lt;SPAN&gt;ScaleString&lt;/SPAN&gt; = &lt;SPAN&gt;oScale&lt;/SPAN&gt;.&lt;SPAN&gt;Replace&lt;/SPAN&gt;(&lt;SPAN&gt;"/"&lt;/SPAN&gt;,&lt;SPAN&gt;":"&lt;/SPAN&gt;)
	&lt;SPAN&gt;Next&lt;/SPAN&gt;
&lt;SPAN&gt;Next&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Try this rule in Inv 2020 and it works very well&lt;BR /&gt;I hope this helps with your problem. Regards&lt;/P&gt;</description>
      <pubDate>Sat, 09 Nov 2019 13:38:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/to-change-drawing-view-scale-formatting-to-or-vice-versa/m-p/9137144#M102952</guid>
      <dc:creator>Sergio.D.Suárez</dc:creator>
      <dc:date>2019-11-09T13:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: To Change Drawing View Scale Formatting (/ to : or vice versa)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/to-change-drawing-view-scale-formatting-to-or-vice-versa/m-p/9137304#M102954</link>
      <description>&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;P&gt;Great help.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Nov 2019 17:49:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/to-change-drawing-view-scale-formatting-to-or-vice-versa/m-p/9137304#M102954</guid>
      <dc:creator>RoyWickrama_RWEI</dc:creator>
      <dc:date>2019-11-09T17:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: To Change Drawing View Scale Formatting (/ to : or vice versa)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/to-change-drawing-view-scale-formatting-to-or-vice-versa/m-p/9137379#M102956</link>
      <description>&lt;P&gt;Hi Sergio.&lt;/P&gt;&lt;P&gt;Great help. I am also doing with&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;DETAIL views (view name is static in view label)&lt;/LI&gt;&lt;LI&gt;SECTION views (section name static in view label)&lt;/LI&gt;&lt;LI&gt;incorporate Custom Properties, say GRADE in the sample (not sure how to do!)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Could you kindly help me to get then in the view labels.&lt;/P&gt;&lt;P&gt;Sorry for having to bother you.&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;P&gt;Sample attached.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2019-11-09 11_39_54-Window.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/696349iCE0072C29F21DA1C/image-size/large?v=v2&amp;amp;px=999" role="button" title="2019-11-09 11_39_54-Window.png" alt="2019-11-09 11_39_54-Window.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Nov 2019 20:03:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/to-change-drawing-view-scale-formatting-to-or-vice-versa/m-p/9137379#M102956</guid>
      <dc:creator>RoyWickrama_RWEI</dc:creator>
      <dc:date>2019-11-09T20:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: To Change Drawing View Scale Formatting (/ to : or vice versa)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/to-change-drawing-view-scale-formatting-to-or-vice-versa/m-p/9524567#M110974</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2129088"&gt;@RoyWickrama_RWEI&lt;/a&gt;.&amp;nbsp; Not sure if you ever figured out how to do your final request here or not, but here's a tip to help you figure out how to write the FormattedText portion of the code.&amp;nbsp; The FormattedText uses XML programming language within, so it's a bit tricky.&amp;nbsp; If you're not a pro at writing and understatding XML, usually the best to get your String formatted the way you want it is to use something like a MessageBox.Show(), MsgBox(), or InputBox().&lt;/P&gt;&lt;P&gt;Create the View label the way you want it manually on the drawing, then access it by code and show the oView.Label.FormattedText in one of those messages to youself.&amp;nbsp; That will show you exactly how it is formatted "behind the scene".&amp;nbsp; If you use either InputBox() or InputListBox() you will be able to select and copy the resulting string.&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2020 18:17:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/to-change-drawing-view-scale-formatting-to-or-vice-versa/m-p/9524567#M110974</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-05-18T18:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: To Change Drawing View Scale Formatting (/ to : or vice versa)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/to-change-drawing-view-scale-formatting-to-or-vice-versa/m-p/9862445#M118009</link>
      <description>&lt;P&gt;Hi Sergio,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using your rule but changed it to go from "/" to "=". It works great when running it from inside a drawing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want it to run automatically when I open a new drawing so that when I add the first view, the scale format is correct. I've tried playing with the trigger settings but haven't been able to get it to work. I'm thinking it may have something to do with the drawing not having any views when first opening. Could that be the case? Is it possible to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2020 17:46:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/to-change-drawing-view-scale-formatting-to-or-vice-versa/m-p/9862445#M118009</guid>
      <dc:creator>hhls11</dc:creator>
      <dc:date>2020-11-11T17:46:28Z</dc:date>
    </item>
  </channel>
</rss>

