<?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 create a section view from my base view using i logic in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-section-view-from-my-base-view-using-i-logic/m-p/12310933#M17749</link>
    <description>&lt;P&gt;i just tring to create a section view from my base view . im looking for te code. can any one help me with code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;view1 --&amp;gt; section line&amp;nbsp; direction ---&amp;gt; distance ----&amp;gt; generare view&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="sureshrext_0-1697533687973.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1280115i3EB2C41744376FE2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sureshrext_0-1697533687973.png" alt="sureshrext_0-1697533687973.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;</description>
    <pubDate>Tue, 17 Oct 2023 09:08:13 GMT</pubDate>
    <dc:creator>suresh.r.ext</dc:creator>
    <dc:date>2023-10-17T09:08:13Z</dc:date>
    <item>
      <title>create a section view from my base view using i logic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-section-view-from-my-base-view-using-i-logic/m-p/12310933#M17749</link>
      <description>&lt;P&gt;i just tring to create a section view from my base view . im looking for te code. can any one help me with code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;view1 --&amp;gt; section line&amp;nbsp; direction ---&amp;gt; distance ----&amp;gt; generare view&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="sureshrext_0-1697533687973.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1280115i3EB2C41744376FE2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sureshrext_0-1697533687973.png" alt="sureshrext_0-1697533687973.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 09:08:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-section-view-from-my-base-view-using-i-logic/m-p/12310933#M17749</guid>
      <dc:creator>suresh.r.ext</dc:creator>
      <dc:date>2023-10-17T09:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: create a section view from my base view using i logic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-section-view-from-my-base-view-using-i-logic/m-p/12311239#M17750</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12732673"&gt;@suresh.r.ext&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is some informations related to creating section views using the API :&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=DrawingViews_AddSectionView" target="_blank"&gt;Inventor 2024 Help | DrawingViews.AddSectionView Method | Autodesk&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;You need to create a drawing sketch first on the main drawing view, draw the section line &amp;amp; then only create the section view. About this sketch, will it&amp;nbsp; be already drawn? Or do we need to code it ? Where will it be ? Can you provide pictures of the derired result ?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Kind regards,&lt;/P&gt;&lt;P&gt;FINET L.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 11:33:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-section-view-from-my-base-view-using-i-logic/m-p/12311239#M17750</guid>
      <dc:creator>FINET_Laurent</dc:creator>
      <dc:date>2023-10-17T11:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: create a section view from my base view using i logic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-section-view-from-my-base-view-using-i-logic/m-p/12311742#M17751</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12732673"&gt;@suresh.r.ext&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I had this example on hand. Note that this does some conversion from cm to inch that might not be needed for your work. It also breaks the view alignment, but you can remove that if not needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See attached Inventor 2023 files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank" rel="noopener"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="visual-basic"&gt;Sub Main
	Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument
	Dim oTG As TransientGeometry = ThisApplication.TransientGeometry

	Dim oUOM As UnitsOfMeasure = oDrawDoc.UnitsOfMeasure
	oInvUnits = UnitsTypeEnum.kCentimeterLengthUnits
	oCnvt_cm_to_in = oUOM.ConvertUnits(1, oUOM.LengthUnits, oInvUnits) 'cm to inch (2.54)
	oCnvt_in_to_cm = oUOM.ConvertUnits(1, oInvUnits, oUOM.LengthUnits) 'inch to cm (.3937...)

	'get the sheet
	Dim oSheet As Sheet
	oSheet = oDrawDoc.ActiveSheet

	'get base view
	Dim oBaseView As DrawingView
	oBaseView = oSheet.DrawingViews.Item(1)

	Dim SketchName As String = "Section Sketch"
	Dim SectionViewName As String = "Z"

	'[ delete section view if it already exits
	For Each View As DrawingView In oSheet.DrawingViews

		'delete view from previous try if it exists
		If View.name = SectionViewName Then
			Try : View.Delete : Catch : End Try
		End If

		'delete sketch if it already exits
		Try : oBaseView.Sketches.Item(SketchName).Delete : Catch : End Try
	Next
	']

	Dim SectionSketch As DrawingSketch = oBaseView.Sketches.Add
	SectionSketch.Edit

	viewExtendPercent = 0.05
	Left_X = oBaseView.Center.X - (oBaseView.Width / 2) -(oBaseView.Width * viewExtendPercent)
	Right_X = oBaseView.Center.X + (oBaseView.Width / 2) + (oBaseView.Width * viewExtendPercent)

	Dim SectionPoint_L As Point2d = oTG.CreatePoint2d(Left_X, oBaseView.Center.Y)
	Dim SectionPoint_R As Point2d = oTG.CreatePoint2d(Right_X, oBaseView.Center.Y)
	Dim SheetPoint_L As Point2d = SectionSketch.SheetToSketchSpace(SectionPoint_L)
	Dim SheetPoint_R As Point2d = SectionSketch.SheetToSketchSpace(SectionPoint_R)
	Dim SketchLine As Inventor.SketchLine = SectionSketch.SketchLines.AddByTwoPoints(SheetPoint_L, SheetPoint_R)

	SectionSketch.ExitEdit
	SectionSketch.Name = SketchName

	'section view placement point 
	'the X is intially ignored because of the view alignment, but we reuse this point after alignment is broken
	Dim ViewCenterPoint As Point2d = oTG.CreatePoint2d(oBaseView.Center.X + 10, oBaseView.Center.Y + oBaseView.Height)

	Dim SectionView As Inventor.SectionDrawingView
	SectionView = oSheet.DrawingViews.AddSectionView(oBaseView, SectionSketch, ViewCenterPoint,
	DrawingViewStyleEnum.kFromBaseDrawingViewStyle, , , SectionViewName)
	SectionView.Aligned = False 'break alignement
	SectionView.Center = ViewCenterPoint 'move view

	SectionView.ReverseDirection
End Sub
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 15:49:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-section-view-from-my-base-view-using-i-logic/m-p/12311742#M17751</guid>
      <dc:creator>Curtis_W</dc:creator>
      <dc:date>2023-10-17T15:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: create a section view from my base view using i logic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-section-view-from-my-base-view-using-i-logic/m-p/12313299#M17752</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/105031"&gt;@Curtis_W&lt;/a&gt;Thanks it helps&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_heart_eyes:"&gt;😍&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2023 06:33:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-section-view-from-my-base-view-using-i-logic/m-p/12313299#M17752</guid>
      <dc:creator>suresh.r.ext</dc:creator>
      <dc:date>2023-10-18T06:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: create a section view from my base view using i logic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-section-view-from-my-base-view-using-i-logic/m-p/13339285#M17753</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/105031"&gt;@Curtis_W&lt;/a&gt;&amp;nbsp;and everyone.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on creating a section view using the code below. However, I need to crop it in a specific way, as shown in the attached images.&lt;/P&gt;&lt;P&gt;Does anyone know how I can make this crop in the section view?&lt;/P&gt;&lt;P&gt;I was considering using a work point that I already have in one of the parts (Point2), which is located exactly in the center of the connection I want to section.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate any suggestions or ideas. Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Class Detalles
	Public oDrawDoc As DrawingDocument 
	Public oTG As TransientGeometry
	'get the sheet
	Public oSheet As Sheet
	'get base view
	Public oBaseView As DrawingView
	
	Public SketchName As String 
	Public SectionViewName As String 
	Public oPartDoc As AssemblyDocument
	
	Sub Main()
		
		oDrawDoc = ThisApplication.ActiveDocument
		oTG = ThisApplication.TransientGeometry
		oSheet = oDrawDoc.ActiveSheet
		oBaseView = oSheet.DrawingViews.Item(3)
		SketchName  = "Section Sketch"
		SectionViewName  = "Z"
		
		'VistaDetalle()
		
		VistaSeccion()
	End Sub
	
'	Sub VistaDetalle()
		
'	End Sub
	
	Sub VistaSeccion()
	
		'[ delete section view if it already exits
		For Each View As DrawingView In oSheet.DrawingViews
	
			'delete view from previous try if it exists
			If View.name = SectionViewName Then
				Try : View.Delete : Catch : End Try
			End If
	
			'delete sketch if it already exits
			Try : oBaseView.Sketches.Item(SketchName).Delete : Catch : End Try
		Next
		']
	
		Dim SectionSketch As DrawingSketch = oBaseView.Sketches.Add
		SectionSketch.Edit
	
		viewExtendPercent = 0.05
		Dim angulo As Double = 170
		X = oBaseView.Center.X + (6 * Cos((3.1416/180)*angulo))
		Y = oBaseView.Center.Y + (6 * Sin((3.1416/180)*angulo))
	
		Dim SectionPoint_L As Point2d = oTG.CreatePoint2d(oBaseView.Center.X, oBaseView.Center.Y)
		Dim SectionPoint_R As Point2d = oTG.CreatePoint2d(X, Y)
		Dim SheetPoint_L As Point2d = SectionSketch.SheetToSketchSpace(SectionPoint_L)
		Dim SheetPoint_R As Point2d = SectionSketch.SheetToSketchSpace(SectionPoint_R)
		Dim SketchLine As Inventor.SketchLine = SectionSketch.SketchLines.AddByTwoPoints(SheetPoint_L, SheetPoint_R)
	
		SectionSketch.ExitEdit
		SectionSketch.Name = SketchName
	
		'section view placement point 
		'the X is intially ignored because of the view alignment, but we reuse this point after alignment is broken
		Dim ViewCenterPoint As Point2d = oTG.CreatePoint2d(oBaseView.Center.X + 10, oBaseView.Center.Y + oBaseView.Height)
	
		Dim SectionView As Inventor.SectionDrawingView
		SectionView = oSheet.DrawingViews.AddSectionView(oBaseView, SectionSketch, ViewCenterPoint,
		DrawingViewStyleEnum.kFromBaseDrawingViewStyle, , , SectionViewName)
		SectionView.Aligned = False 'break alignement
		SectionView.Center = ViewCenterPoint 'move view
	
		SectionView.ReverseDirection
		
		Dim rotacion As Double
		
		If angulo &amp;gt; 37 And angulo &amp;lt; 270 Then
			rotacion = (3.1416 / 180) * (angulo - 180)
		Else
			rotacion = (3.1416 / 180) * (angulo)
		End If
		
		SectionView.RotateByAngle(rotacion, True)
	End Sub

End Class&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&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="est_david_bermudez_2-1740511930733.png" style="width: 933px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1471029iC67B669654CC1EBF/image-dimensions/933x363?v=v2" width="933" height="363" role="button" title="est_david_bermudez_2-1740511930733.png" alt="est_david_bermudez_2-1740511930733.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="est_david_bermudez_3-1740512112623.png" style="width: 240px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1471032iCA174E846AFF1658/image-dimensions/240x408?v=v2" width="240" height="408" role="button" title="est_david_bermudez_3-1740512112623.png" alt="est_david_bermudez_3-1740512112623.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2025 19:39:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-section-view-from-my-base-view-using-i-logic/m-p/13339285#M17753</guid>
      <dc:creator>est_david_bermudez</dc:creator>
      <dc:date>2025-02-25T19:39:30Z</dc:date>
    </item>
  </channel>
</rss>

