<?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: Ilogic move drawingdimensions in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-move-drawingdimensions/m-p/11926489#M151961</link>
    <description>&lt;P&gt;a good rule of thumb is to have one dimension per side. And how should it be changed if there were more dimensions? On the left are three dimensional lines.&lt;/P&gt;</description>
    <pubDate>Thu, 27 Apr 2023 17:26:32 GMT</pubDate>
    <dc:creator>vvvxxvvv333</dc:creator>
    <dc:date>2023-04-27T17:26:32Z</dc:date>
    <item>
      <title>Ilogic move drawingdimensions</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-move-drawingdimensions/m-p/9013701#M101114</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to move some drawingdimensions with ilogic, but it is not working.&amp;nbsp;&lt;/P&gt;&lt;P&gt;with the help of the VBA tool i could find the coordinates of the dimensionlines, but it looks they are read-only.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why are these dimensions read only, and can't be moved with ilogic?&lt;/P&gt;&lt;P&gt;for my code i have a simple drawing that has 4 dimensions on it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Dim osheet As Sheet = ThisApplication.ActiveDocument.activesheet
Dim oview As DrawingView = osheet.DrawingViews(1)
Dim dimension As GeneralDimension

For Each dimension In osheet.DrawingDimensions
	Trace.WriteLine(dimension.ModelValue)
	
	If dimension.DimensionLine.direction.y = 1 Then
		Trace.WriteLine("Direction y=1")
		dimension.DimensionLine.MidPoint.X = oview.Center.X - (oview.Width * 0.5) - 0.6
	ElseIf dimension.DimensionLine.direction.y = -1 Then
		Trace.WriteLine("Direction y=-1")
		dimension.DimensionLine.MidPoint.X = oview.Center.X + (oview.Width * 0.5) + 0.6
	ElseIf dimension.DimensionLine.direction.x = 1 Then
		Trace.WriteLine("Direction x=1")
		dimension.DimensionLine.MidPoint.Y = oview.Center.Y - (oview.Height * 0.5) -0.6
	ElseIf dimension.DimensionLine.direction.x = -1 Then
		Trace.WriteLine("Direction x=-1")
		dimension.DimensionLine.MidPoint.Y = oview.Center.Y + (oview.Height * 0.5) + 0.6
	End If
	
Next
Trace.WriteLine("rule done")&lt;/PRE&gt;&lt;P&gt;i also tried to create a point2D and then move the MidPoint of the dimensionline to the point. but that also doesn't work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am able to read out all the values of the dimensionline, so ilogic can find the correct properties.&lt;/P&gt;&lt;PRE&gt;Trace.WriteLine(dimension.DimensionLine.MidPoint.X &amp;amp; " " &amp;amp; dimension.DimensionLine.MidPoint.Y)&lt;/PRE&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Geert&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 11:21:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-move-drawingdimensions/m-p/9013701#M101114</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-09T11:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic move drawingdimensions</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-move-drawingdimensions/m-p/9014914#M101129</link>
      <description>&lt;P&gt;You're on the right track with the point2D but try moving the Text.Origin&lt;/P&gt;&lt;PRE&gt;dimension.Text.Origin = &lt;SPAN&gt;ThisServer&lt;/SPAN&gt;.&lt;SPAN&gt;TransientGeometry.CreatePoint2D((&lt;/SPAN&gt;oview.Center.X - (oview.Width * 0.5) - 0.6), dimension.Text.Origin.Y)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 20:30:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-move-drawingdimensions/m-p/9014914#M101129</guid>
      <dc:creator>clutsa</dc:creator>
      <dc:date>2019-09-09T20:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic move drawingdimensions</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-move-drawingdimensions/m-p/9014929#M101130</link>
      <description>&lt;P&gt;i see that &lt;SPAN class="UserName lia-user-name lia-user-rank-Collaborator lia-component-message-view-widget-author-username"&gt;&lt;A href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5352440" target="_self"&gt;&lt;SPAN class=""&gt;clutsa&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt; just answerd your question befor i could post my code. i will post it anyway because &lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;it's a bit more extensive&lt;/SPAN&gt;&lt;/SPAN&gt; but comes down to the same.&lt;/P&gt;&lt;PRE&gt;        Dim doc As DrawingDocument = ThisApplication.ActiveDocument
        Dim oSheet As Sheet = doc.ActiveSheet

        Dim oview As DrawingView = osheet.DrawingViews(1)
        'Dim dimension As GeneralDimension

        Dim oTg = ThisApplication.TransientGeometry

        For Each dimension As DrawingDimension In oSheet.DrawingDimensions

            Dim midPointText As Point2d = dimension.Text.Origin
            Dim midPointView = oview.Center
            Dim textHeight = 0.5

            Dim newX As Double
            Dim newY As Double

            Dim deltaX As Double = (oview.Width * 0.5) + 0.6
            Dim deltaY As Double = (oview.Height * 0.5) + 0.6

            If (midPointText.X &amp;gt; midPointView.X + oview.Width / 2) Then
                newX = midPointView.X + deltaX
                newY = midPointView.Y
            End If
            If (midPointText.X &amp;lt; midPointView.X - oview.Width / 2) Then
                newX = midPointView.X - deltaX - textHeight
                newY = midPointView.Y
            End If

            If (midPointText.Y &amp;gt; midPointView.Y + oview.Height / 2) Then
                newX = midPointView.X
                newY = midPointView.Y + deltaY + textHeight
            End If
            If (midPointText.Y &amp;lt; midPointView.Y - oview.Height / 2) Then
                newX = midPointView.X
                newY = midPointView.Y - deltaY
            End If

            Dim newMidPoint As Point2d = oTg.CreatePoint2d(newX, newY)

            dimension.Text.Origin = newMidPoint
        Next&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Sep 2019 20:40:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-move-drawingdimensions/m-p/9014929#M101130</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2019-09-09T20:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic move drawingdimensions</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-move-drawingdimensions/m-p/9015657#M101145</link>
      <description>&lt;P&gt;Thanks!! that worked great!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but as clutsa did in the code, when y or x don't change they should be:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;newY = dimension.Text.Origin.Y&lt;/PRE&gt;&lt;P&gt;or&lt;/P&gt;&lt;PRE&gt;newX = dimension.Text.Origin.X&lt;/PRE&gt;&lt;P&gt;then they move like they should.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 06:58:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-move-drawingdimensions/m-p/9015657#M101145</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-10T06:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic move drawingdimensions</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-move-drawingdimensions/m-p/11926489#M151961</link>
      <description>&lt;P&gt;a good rule of thumb is to have one dimension per side. And how should it be changed if there were more dimensions? On the left are three dimensional lines.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 17:26:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-move-drawingdimensions/m-p/11926489#M151961</guid>
      <dc:creator>vvvxxvvv333</dc:creator>
      <dc:date>2023-04-27T17:26:32Z</dc:date>
    </item>
  </channel>
</rss>

