<?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: Sketch a Custom Propertie on a planar face of an occurence in an assembly. in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/sketch-a-custom-propertie-on-a-planar-face-of-an-occurence-in-an/m-p/8892179#M99245</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4427777"&gt;@chandra.shekar.g&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry for confusing you.&lt;/P&gt;&lt;P&gt;I still have to gain experience in programming..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. From selected occurrence&lt;/P&gt;&lt;P&gt;2. Created in Top assembly&lt;/P&gt;&lt;P&gt;3. Selected occurrence can be both part of assy.&lt;/P&gt;</description>
    <pubDate>Fri, 05 Jul 2019 12:55:11 GMT</pubDate>
    <dc:creator>hkempeneers</dc:creator>
    <dc:date>2019-07-05T12:55:11Z</dc:date>
    <item>
      <title>Sketch a Custom Propertie on a planar face of an occurence in an assembly.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/sketch-a-custom-propertie-on-a-planar-face-of-an-occurence-in-an/m-p/8888144#M99137</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We try to place a sketch with a Custom Propertie on a planar face of all appearances in an assembly. Each appearance has an unique Description and in this case we want to see them in the assembly.&lt;/P&gt;&lt;P&gt;I have write the following iLogic code: (The error message is below)&lt;/P&gt;&lt;P&gt;Does anyone know what I'm doing wrong?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Rule 27.JPG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/653715iE83CE5996D59107B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Rule 27.JPG" alt="Rule 27.JPG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Rule 27_Error.JPG" style="width: 821px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/653714iC85D2412ADF78384/image-size/large?v=v2&amp;amp;px=999" role="button" title="Rule 27_Error.JPG" alt="Rule 27_Error.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 14:26:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/sketch-a-custom-propertie-on-a-planar-face-of-an-occurence-in-an/m-p/8888144#M99137</guid>
      <dc:creator>hkempeneers</dc:creator>
      <dc:date>2019-07-03T14:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Sketch a Custom Propertie on a planar face of an occurence in an assembly.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/sketch-a-custom-propertie-on-a-planar-face-of-an-occurence-in-an/m-p/8889052#M99155</link>
      <description>&lt;P&gt;You didn't include any declaration or assignment to the variable named oOccurrence. Can you post your complete rule as a text file?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 20:23:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/sketch-a-custom-propertie-on-a-planar-face-of-an-occurence-in-an/m-p/8889052#M99155</guid>
      <dc:creator>MjDeck</dc:creator>
      <dc:date>2019-07-03T20:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: Sketch a Custom Propertie on a planar face of an occurence in an assembly.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/sketch-a-custom-propertie-on-a-planar-face-of-an-occurence-in-an/m-p/8889627#M99167</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5171147"&gt;@hkempeneers&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below modification may be helpful in creating sketch after selection of face.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;    Dim oFace As Face
    oFace = ThisApplication.CommandManager.Pick(kPartFacePlanarFilter, "Select a face")
    
    Dim occ As ComponentOccurrence
    occ = oFace.ContainingOccurrence
    
    Dim oFaceProxy As FaceProxy
    
    Call occ.CreateGeometryProxy(oFace, oFaceProxy)
    
    If oFaceProxy.SurfaceType = kPlaneSurface Then
        oSketch = oAssDef.Sketches.Add(oFaceProxy)
    End If&lt;/PRE&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 05:40:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/sketch-a-custom-propertie-on-a-planar-face-of-an-occurence-in-an/m-p/8889627#M99167</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2019-07-04T05:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: Sketch a Custom Propertie on a planar face of an occurence in an assembly.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/sketch-a-custom-propertie-on-a-planar-face-of-an-occurence-in-an/m-p/8889671#M99170</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/537534"&gt;@MjDeck&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim comp As Object&lt;BR /&gt;Dim oAssDoc As Object&lt;/P&gt;&lt;P&gt;comp = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyOccurrenceFilter, "Selecteer een component")&lt;/P&gt;&lt;P&gt;oAssDoc = comp&lt;BR /&gt;&lt;BR /&gt;If TypeOf oOccurrence Is ComponentOccurrenceProxy Then&lt;BR /&gt;Prop = iProperties.Value(oAssDoc.NativeObject.Name, "Project", "Description")&lt;BR /&gt;Else&lt;BR /&gt;Prop = iProperties.Value(oAssDoc.Name, "Project", "Description")&lt;BR /&gt;End If&lt;BR /&gt;&lt;BR /&gt;Dim oAssDef As AssemblyComponentDefinition = oAssDoc.Definition&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Dim oFace As Face&lt;BR /&gt;oFace = ThisApplication.CommandManager.Pick (SelectionFilterEnum.kAllPlanarEntities,"Selecteer een vlak")&lt;/P&gt;&lt;P&gt;' make sure it Is a planar face&lt;BR /&gt;If oFace.SurfaceType = SurfaceTypeEnum.kPlaneSurface Then&lt;BR /&gt;&lt;BR /&gt;oPlanarSurface = oFace.Geometry&lt;BR /&gt;&lt;BR /&gt;'add a sketch&lt;BR /&gt;oSketch = oAssDef.Sketches.Add(oFace)&lt;BR /&gt;&lt;BR /&gt;'trying to choose an appropriate point&lt;BR /&gt;'assume this planar face has one edge loop only&lt;BR /&gt;oEdgeLoop = oFace.EdgeLoops(1)&lt;BR /&gt;&lt;BR /&gt;oMinPt = oEdgeLoop.RangeBox.MinPoint&lt;BR /&gt;oMaxPt = oEdgeLoop.RangeBox.MaxPoint&lt;BR /&gt;&lt;BR /&gt;CenterPt = oAssDef.TransientGeometry.CreatePoint((oMaxPt.X + oMinPt.X) / 2#, (oMaxPt.Y + oMinPt.Y) / 2#, (oMaxPt.Z + oMinPt.Z) / 2#)&lt;BR /&gt;&lt;BR /&gt;'get one point on the face and transform to the point2d on the sketch&lt;BR /&gt;'oTextPt = oSketch.ModelToSketchSpace(oPlanarSurface.RootPoint)&lt;BR /&gt;oTextPt = oSketch.ModelToSketchSpace(CenterPt)&lt;BR /&gt;&lt;BR /&gt;'add the textbox&lt;BR /&gt;oSketchText = oSketch.TextBoxes.AddFitted(oTextPt, "&amp;lt;StyleOverride FontSize='30'&amp;gt;" &amp;amp; Prop &amp;amp; "&amp;lt;/StyleOverride&amp;gt;")&lt;BR /&gt;&lt;BR /&gt;Else&lt;BR /&gt;MsgBox( "Selecteer een vlak, en geen ronding, aub!")&lt;BR /&gt;End If&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 06:12:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/sketch-a-custom-propertie-on-a-planar-face-of-an-occurence-in-an/m-p/8889671#M99170</guid>
      <dc:creator>hkempeneers</dc:creator>
      <dc:date>2019-07-04T06:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Sketch a Custom Propertie on a planar face of an occurence in an assembly.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/sketch-a-custom-propertie-on-a-planar-face-of-an-occurence-in-an/m-p/8891492#M99232</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4427777"&gt;@chandra.shekar.g&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This modification doesn't fix my problem.&lt;/P&gt;&lt;P&gt;The same error message continues to appear.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 06:07:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/sketch-a-custom-propertie-on-a-planar-face-of-an-occurence-in-an/m-p/8891492#M99232</guid>
      <dc:creator>hkempeneers</dc:creator>
      <dc:date>2019-07-05T06:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: Sketch a Custom Propertie on a planar face of an occurence in an assembly.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/sketch-a-custom-propertie-on-a-planar-face-of-an-occurence-in-an/m-p/8891902#M99236</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5171147"&gt;@hkempeneers&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please answer below questions?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;iProperty value of "Description" is taken from Top assembly or Selected occurrence?&lt;/LI&gt;
&lt;LI&gt;Sketch is&amp;nbsp; created in Top assembly or selected occurrence?&lt;/LI&gt;
&lt;LI&gt;Selected occurrence is assembly document or part document?&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;It's very confusion in coding.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 10:01:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/sketch-a-custom-propertie-on-a-planar-face-of-an-occurence-in-an/m-p/8891902#M99236</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2019-07-05T10:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: Sketch a Custom Propertie on a planar face of an occurence in an assembly.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/sketch-a-custom-propertie-on-a-planar-face-of-an-occurence-in-an/m-p/8892179#M99245</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4427777"&gt;@chandra.shekar.g&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry for confusing you.&lt;/P&gt;&lt;P&gt;I still have to gain experience in programming..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. From selected occurrence&lt;/P&gt;&lt;P&gt;2. Created in Top assembly&lt;/P&gt;&lt;P&gt;3. Selected occurrence can be both part of assy.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 12:55:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/sketch-a-custom-propertie-on-a-planar-face-of-an-occurence-in-an/m-p/8892179#M99245</guid>
      <dc:creator>hkempeneers</dc:creator>
      <dc:date>2019-07-05T12:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: Sketch a Custom Propertie on a planar face of an occurence in an assembly.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/sketch-a-custom-propertie-on-a-planar-face-of-an-occurence-in-an/m-p/8894749#M99271</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5171147"&gt;@hkempeneers&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try below iLogic code.&lt;/P&gt;
&lt;PRE&gt;Dim comp As ComponentOccurrence   
comp = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyOccurrenceFilter, "Selecteer een component")  

If TypeOf oOccurrence Is ComponentOccurrenceProxy Then

    Prop = iProperties.Value(comp.NativeObject.Name, "Project", "Description")

Else 

    Prop = iProperties.Value(comp.Name, "Project", "Description")

End If 

Dim oAssDef As AssemblyComponentDefinition = ThisDoc.Document.ComponentDefinition

Dim oFace As Face

oFace = ThisApplication.CommandManager.Pick (SelectionFilterEnum.kAllPlanarEntities,"Selecteer een vlak") 

'		make sure it Is a planar face

If oFace.SurfaceType = SurfaceTypeEnum.kPlaneSurface Then

		Dim oFaceProxy As FaceProxy 
		comp.CreateGeometryProxy(oFace, oFaceProxy)

		oPlanarSurface = oFace.Geometry 
		'add a sketch

		oSketch = oAssDef.Sketches.Add(oFaceProxy)  

		'trying to choose an appropriate point

		'assume this planar face has one edge loop only

		oEdgeLoop = oFaceProxy.EdgeLoops(1) 

		oMinPt = oEdgeLoop.RangeBox.MinPoint 

		oMaxPt = oEdgeLoop.RangeBox.MaxPoint 

		CenterPt = ThisApplication.TransientGeometry.CreatePoint((oMaxPt.X + oMinPt.X) / 2#, (oMaxPt.Y + oMinPt.Y) / 2#, (oMaxPt.Z + oMinPt.Z) / 2#)    

		'get one point on the face and transform to the point2d on the sketch 

		'oTextPt = oSketch.ModelToSketchSpace(oPlanarSurface.RootPoint)

		oTextPt = oSketch.ModelToSketchSpace(CenterPt) 

		'add the textbox

		oSketchText = oSketch.TextBoxes.AddFitted(oTextPt, "&amp;lt;StyleOverride FontSize='30'&amp;gt;" &amp;amp; Prop &amp;amp; "&amp;lt;/StyleOverride&amp;gt;")

Else

		MsgBox( "Selecteer een vlak, en geen ronding, aub!")

End If
&lt;/PRE&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 05:00:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/sketch-a-custom-propertie-on-a-planar-face-of-an-occurence-in-an/m-p/8894749#M99271</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2019-07-08T05:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: Sketch a Custom Propertie on a planar face of an occurence in an assembly.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/sketch-a-custom-propertie-on-a-planar-face-of-an-occurence-in-an/m-p/8894907#M99274</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4427777"&gt;@chandra.shekar.g&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code works great!&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 07:14:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/sketch-a-custom-propertie-on-a-planar-face-of-an-occurence-in-an/m-p/8894907#M99274</guid>
      <dc:creator>hkempeneers</dc:creator>
      <dc:date>2019-07-08T07:14:24Z</dc:date>
    </item>
  </channel>
</rss>

