<?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: Create a rectangle of four lines_2D_OTK Java in Customization</title>
    <link>https://www.ptcusercommunity.com/t5/Customization/Create-a-rectangle-of-four-lines-2D-OTK-Java/m-p/639260#M8957</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I believe that the trick is &lt;STRONG&gt;SetIntentManagerMode()&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;sketch.SetIntentManagerMode(true); // magic ON
Point2D center = wfcSession.CreatePoint2D(0.00,0.00);		    		    
SectionEntityCircle circle = wfcSection.SectionEntityCircle_Create(center,300.00);		    		    
SectionEntity entity = (SectionEntity)circle;		    		    		    
sketch.AddEntity(entity);
circle = wfcSection.SectionEntityCircle_Create(center,20.00);
entity = (SectionEntity)circle;
sketch.AddEntity(entity);
sketch.SetIntentManagerMode(false); // magic OFF&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Dec 2019 08:17:38 GMT</pubDate>
    <dc:creator>YaroslavSin</dc:creator>
    <dc:date>2019-12-04T08:17:38Z</dc:date>
    <item>
      <title>Create a rectangle of four lines_2D_OTK Java</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/Create-a-rectangle-of-four-lines-2D-OTK-Java/m-p/639115#M8955</link>
      <description>&lt;P&gt;Hello everyone!&lt;/P&gt;
&lt;P&gt;I am trying to create a rectangle of four lines using OTK Java. This will be a section for my extrusion. All lines for the extrusion must be coincident. But I don’t know how to make them like that.&lt;BR /&gt;Because of this, it is not possible to extrude.&lt;/P&gt;
&lt;P&gt;My code is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;Point2Ds tops = Point2Ds.create();
Point2D A = wfcSession.CreatePoint2D(90.00,90.00);
Point2D B = wfcSession.CreatePoint2D(90.00,-90.00);
Point2D C = wfcSession.CreatePoint2D(-90.00,-90.00);
Point2D D = wfcSession.CreatePoint2D(-90.00,90.00);
Point2D E = wfcSession.CreatePoint2D(90.00,90.00);
tops.set(0, A); tops.set(1, B); tops.set(2, C); tops.set(3, D); tops.set(4, E);
SectionEntityPolyline rectangle = wfcSection.SectionEntityPolyline_Create(tops);
SectionEntity entity = (SectionEntity)rectangle;
sketch.AddEntity(entity);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Section that is obtained after starting:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Снимок.PNG" style="width: 658px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/21630iBC882D1BEDAF84AE/image-dimensions/658x646?v=v2" width="658" height="646" role="button" title="Снимок.PNG" alt="Снимок.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Please help, if anyone knows.&lt;BR /&gt;Thanks in advance.&lt;BR /&gt;Regards!&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 13:01:24 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/Create-a-rectangle-of-four-lines-2D-OTK-Java/m-p/639115#M8955</guid>
      <dc:creator>VladiSlav</dc:creator>
      <dc:date>2019-12-03T13:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: Create a rectangle of four lines_2D_OTK Java</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/Create-a-rectangle-of-four-lines-2D-OTK-Java/m-p/639260#M8957</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I believe that the trick is &lt;STRONG&gt;SetIntentManagerMode()&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;sketch.SetIntentManagerMode(true); // magic ON
Point2D center = wfcSession.CreatePoint2D(0.00,0.00);		    		    
SectionEntityCircle circle = wfcSection.SectionEntityCircle_Create(center,300.00);		    		    
SectionEntity entity = (SectionEntity)circle;		    		    		    
sketch.AddEntity(entity);
circle = wfcSection.SectionEntityCircle_Create(center,20.00);
entity = (SectionEntity)circle;
sketch.AddEntity(entity);
sketch.SetIntentManagerMode(false); // magic OFF&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 08:17:38 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/Create-a-rectangle-of-four-lines-2D-OTK-Java/m-p/639260#M8957</guid>
      <dc:creator>YaroslavSin</dc:creator>
      <dc:date>2019-12-04T08:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: Create a rectangle of four lines_2D_OTK Java</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/Create-a-rectangle-of-four-lines-2D-OTK-Java/m-p/639270#M8958</link>
      <description>&lt;P&gt;Thanks for the answer!&lt;BR /&gt;Yes, I understand that I need to enable &lt;EM&gt;&lt;STRONG&gt;ManagerMode&lt;/STRONG&gt;&lt;/EM&gt;.&lt;BR /&gt;I already did that and everything worked with the round section.&lt;BR /&gt;Now I want to create a part with a rectangular section, but I can’t draw such a section.&lt;BR /&gt;Best Regards!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 08:33:39 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/Create-a-rectangle-of-four-lines-2D-OTK-Java/m-p/639270#M8958</guid>
      <dc:creator>VladiSlav</dc:creator>
      <dc:date>2019-12-04T08:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: Create a rectangle of four lines_2D_OTK Java</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/Create-a-rectangle-of-four-lines-2D-OTK-Java/m-p/639372#M8964</link>
      <description>&lt;P&gt;In toolkit examples (UgCreoSweepCreate.c) I found this piece of code&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;ProError UgSweepAppAddRectangle (ProSection nsketch,int offset)
{
	Pro2dLinedef rect_entity1,rect_entity2,rect_entity3,rect_entity4;
	int ent_id=0;

	rect_entity1.type = PRO_2D_LINE;
    rect_entity1.end1[0] = -50 + (-offset);
	rect_entity1.end1[1] = 40 + offset;
	rect_entity1.end2[0] = 50 + offset;
	rect_entity1.end2[1] = 40 + offset;
	
	rect_entity2.type = PRO_2D_LINE;
    rect_entity2.end1[0] = 50 + offset;
	rect_entity2.end1[1] = 40 + offset;
	rect_entity2.end2[0] = 50 + offset;
	rect_entity2.end2[1] = -40 + (-offset);
	
	rect_entity3.type = PRO_2D_LINE;
    rect_entity3.end1[0] = 50 + offset;
	rect_entity3.end1[1] = -40 + (-offset);
	rect_entity3.end2[0] = -50 + (-offset);
	rect_entity3.end2[1] = -40 + (-offset);
	
	rect_entity4.type = PRO_2D_LINE;
    rect_entity4.end1[0] = -50 + (-offset);
	rect_entity4.end1[1] = -40 + (-offset);
	rect_entity4.end2[0] = -50 + (-offset);
	rect_entity4.end2[1] = 40 + offset;	     

	status = ProSectionEntityAdd(nsketch,(Pro2dEntdef*)&amp;amp;(rect_entity1),&amp;amp;ent_id);
	sweep_create_log("ProSectionEntityAdd ");

	status = ProSectionEntityAdd(nsketch,(Pro2dEntdef*)&amp;amp;(rect_entity2),&amp;amp;ent_id);
	sweep_create_log("ProSectionEntityAdd ");

	status = ProSectionEntityAdd(nsketch,(Pro2dEntdef*)&amp;amp;(rect_entity3),&amp;amp;ent_id);
	sweep_create_log("ProSectionEntityAdd ");

	status = ProSectionEntityAdd(nsketch,(Pro2dEntdef*)&amp;amp;(rect_entity4),&amp;amp;ent_id);
	sweep_create_log("ProSectionEntityAdd ");

	status = ProSectionIntentManagerModeSet(nsketch, PRO_B_TRUE);
	sweep_create_log("ProSectionIntentManagerModeSet ");

	status = ProSectionIntentManagerModeSet(nsketch, PRO_B_FALSE);
	sweep_create_log("ProSectionIntentManagerModeSet ");

	return;

}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;Try to use something like this&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;Point2Ds tops = Point2Ds.create();
Point2D A = wfcSession.CreatePoint2D(90.00,90.00);
Point2D B = wfcSession.CreatePoint2D(90.00,-90.00);
Point2D C = wfcSession.CreatePoint2D(-90.00,-90.00);
Point2D D = wfcSession.CreatePoint2D(-90.00,90.00);
Point2D E = wfcSession.CreatePoint2D(90.00,90.00);
tops.set(0, A); tops.set(1, B); tops.set(2, C); tops.set(3, D); tops.set(4, E);
SectionEntityPolyline rectangle = wfcSection.SectionEntityPolyline_Create(tops);
SectionEntity entity = (SectionEntity)rectangle;
sketch.AddEntity(entity);

// ADD
sketch.SetIntentManagerMode(true);
sketch.SetIntentManagerMode(false);&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 04 Dec 2019 15:06:52 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/Create-a-rectangle-of-four-lines-2D-OTK-Java/m-p/639372#M8964</guid>
      <dc:creator>YaroslavSin</dc:creator>
      <dc:date>2019-12-04T15:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: Create a rectangle of four lines_2D_OTK Java</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/Create-a-rectangle-of-four-lines-2D-OTK-Java/m-p/639391#M8965</link>
      <description>&lt;P&gt;Thank you so much!&lt;BR /&gt;It works!&lt;BR /&gt;It was not quite obvious to me.&lt;BR /&gt;Apparently, if I create in an active &lt;EM&gt;&lt;STRONG&gt;ManagerMode&lt;/STRONG&gt;&lt;/EM&gt;, then it perceives each line as a separate object.&lt;BR /&gt;And if I first create and then turn on &lt;EM&gt;&lt;STRONG&gt;ManagerMode&lt;/STRONG&gt;&lt;/EM&gt;, then it takes the whole section from there, as a single object.&lt;BR /&gt;Best Regards!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 16:55:46 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/Create-a-rectangle-of-four-lines-2D-OTK-Java/m-p/639391#M8965</guid>
      <dc:creator>VladiSlav</dc:creator>
      <dc:date>2019-12-04T16:55:46Z</dc:date>
    </item>
  </channel>
</rss>

