<?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: AcGiSubEntityTraits::setLayer() and line weight, transparency and plottable in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/acgisubentitytraits-setlayer-and-line-weight-transparency-and/m-p/5927251#M10601</link>
    <description>&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Yes, i used this in the past, and i see what you mean, as to why not currently the part of&amp;nbsp;mode-&amp;gt;subEntityTraits().setLayer(idLayer); does not takes care of updating the entity as (just for testing purposes), one can get by using AcGiDrawable's and get the effect without doing any of the&amp;nbsp;&lt;SPAN&gt;subEntityTraits().setXXXX calls.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;in example:&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;AcDbCircle* circle = new AcDbCircle(AcGePoint3d::kOrigin, normal, 500);	
circle-&amp;gt;setLayer(idLayer);
mode-&amp;gt;geometry().draw(circle);&lt;/PRE&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;even without testing for isPlotting()...&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Nov 2015 15:41:14 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-11-27T15:41:14Z</dc:date>
    <item>
      <title>AcGiSubEntityTraits::setLayer() and line weight, transparency and plottable</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acgisubentitytraits-setlayer-and-line-weight-transparency-and/m-p/5924169#M10594</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the worlddraw/viewportdraw of my custom entity, I call&amp;nbsp;&lt;STRONG&gt;AcGiSubEntityTraits::setLayer()&lt;/STRONG&gt;&amp;nbsp;several times to change drawing properties of primitives. But, only&amp;nbsp;&lt;STRONG&gt;color&lt;/STRONG&gt; and&amp;nbsp;&lt;STRONG&gt;lineType&lt;/STRONG&gt; are applied from layer. What about &lt;STRONG&gt;line weight&lt;/STRONG&gt;, &lt;STRONG&gt;transparency&amp;nbsp;&lt;/STRONG&gt;and &lt;STRONG&gt;plottable/frozen/inactive&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do I need to manually "sync" these properties? Something like this:&lt;/P&gt;&lt;PRE&gt;wd-&amp;gt;subEntityTraits().setLayer(idLayer);
AcDbLayerTableRecordPointer pLayer(idLayer, AcDb::kForRead);
if(pLayer.openStatus() == Acad::eOk)
{
	wd-&amp;gt;subEntityTraits().setLineWeight(pLayer-&amp;gt;lineWeight());
	wd-&amp;gt;subEntityTraits().set...
}&lt;/PRE&gt;&lt;P&gt;Note: I use layers as properties for&amp;nbsp;my custom entity because it's very user convenient (layer = container of multiple properties).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2015 09:45:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acgisubentitytraits-setlayer-and-line-weight-transparency-and/m-p/5924169#M10594</guid>
      <dc:creator>maisoui</dc:creator>
      <dc:date>2015-11-25T09:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: AcGiSubEntityTraits::setLayer() and line weight, transparency and plottable</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acgisubentitytraits-setlayer-and-line-weight-transparency-and/m-p/5924760#M10595</link>
      <description>&lt;P&gt;Are all those other properties set to "bylayer"?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2015 16:09:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acgisubentitytraits-setlayer-and-line-weight-transparency-and/m-p/5924760#M10595</guid>
      <dc:creator>owenwengerd</dc:creator>
      <dc:date>2015-11-25T16:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: AcGiSubEntityTraits::setLayer() and line weight, transparency and plottable</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acgisubentitytraits-setlayer-and-line-weight-transparency-and/m-p/5925722#M10596</link>
      <description>&lt;P&gt;Yes for sure.&lt;/P&gt;&lt;P&gt;If I change these properties on the layer (of my custom entity), it is applied to all primitives which are yet another layer (i.e. &lt;EM&gt;subEntityTraits()-&amp;gt;setLayer()&lt;/EM&gt;).&lt;/P&gt;&lt;P&gt;A couple of illustrations:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/203052i615F51EED7606040/image-size/original?v=mpbl-1&amp;amp;px=-1" alt="layers1.png" title="layers1.png" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/203053i8BC0EF8E2A4FE022/image-size/original?v=mpbl-1&amp;amp;px=-1" alt="result1.png" title="result1.png" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/203054i470A2E8945AC5856/image-size/original?v=mpbl-1&amp;amp;px=-1" alt="layers2.png" title="layers2.png" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/203055iB6AC3C177C16D550/image-size/original?v=mpbl-1&amp;amp;px=-1" alt="result2.png" title="result2.png" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code to reproduce:&lt;/P&gt;&lt;PRE&gt;Adesk::Boolean BcEntity::subWorldDraw(AcGiWorldDraw * wd)
{
	assertReadEnabled();

	if(wd-&amp;gt;regenAbort() == Adesk::kTrue)
		return Adesk::kTrue;

	wd-&amp;gt;geometry().circle(AcGePoint3d::kOrigin, 600, m_normal);

	AcDbLayerTablePointer pLayerTable(database() == NULL ? curDatabase() : database(), AcDb::kForRead);
	if(pLayerTable.openStatus() == Acad::eOk)
	{
		AcDbObjectId idLayer;

		if(pLayerTable-&amp;gt;getAt(_T("1"), idLayer) == Acad::eOk)
		{
			wd-&amp;gt;subEntityTraits().setLayer(idLayer);
			wd-&amp;gt;geometry().circle(AcGePoint3d::kOrigin, 500, m_normal);
		}

		if(pLayerTable-&amp;gt;getAt(_T("2"), idLayer) == Acad::eOk)
		{
			wd-&amp;gt;subEntityTraits().setLayer(idLayer);
			wd-&amp;gt;geometry().circle(AcGePoint3d::kOrigin, 400, m_normal);
		}

		if(pLayerTable-&amp;gt;getAt(_T("3"), idLayer) == Acad::eOk)
		{
			wd-&amp;gt;subEntityTraits().setLayer(idLayer);
			wd-&amp;gt;geometry().circle(AcGePoint3d::kOrigin, 300, m_normal);
		}

		if(pLayerTable-&amp;gt;getAt(_T("4"), idLayer) == Acad::eOk)
		{
			wd-&amp;gt;subEntityTraits().setLayer(idLayer);
			wd-&amp;gt;geometry().circle(AcGePoint3d::kOrigin, 200, m_normal);
		}

		if(pLayerTable-&amp;gt;getAt(_T("5"), idLayer) == Acad::eOk)
		{
			wd-&amp;gt;subEntityTraits().setLayer(idLayer);
			wd-&amp;gt;geometry().circle(AcGePoint3d::kOrigin, 100, m_normal);
		}
	}

	return Adesk::kTrue;
}&lt;/PRE&gt;&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2015 07:50:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acgisubentitytraits-setlayer-and-line-weight-transparency-and/m-p/5925722#M10596</guid>
      <dc:creator>maisoui</dc:creator>
      <dc:date>2015-11-26T07:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: AcGiSubEntityTraits::setLayer() and line weight, transparency and plottable</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acgisubentitytraits-setlayer-and-line-weight-transparency-and/m-p/5926213#M10597</link>
      <description>&lt;P&gt;&lt;FONT face="courier new,courier"&gt;What Owen commented is about something like this:&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;Adesk::Boolean MyCustomObject::subWorldDraw (AcGiWorldDraw *mode) {
	assertReadEnabled () ;
	
	//if(mode-&amp;gt;regenAbort() == Adesk::kTrue)
	//return Adesk::kTrue;

	AcGeVector3d normal = AcGeVector3d::kZAxis;
	AcCmTransparency transparency;
	transparency.setMethod(AcCmTransparency::kByLayer);

	mode-&amp;gt;geometry().circle(AcGePoint3d::kOrigin, 600, normal);

	AcDbLayerTablePointer pLayerTable(acdbHostApplicationServices()-&amp;gt;workingDatabase(), AcDb::kForRead);
	if(pLayerTable.openStatus() == Acad::eOk)
	{
		AcDbObjectId idLayer;

		if(pLayerTable-&amp;gt;getAt(_T("1"), idLayer) == Acad::eOk)
		{
			mode-&amp;gt;subEntityTraits().setLayer(idLayer);
			mode-&amp;gt;subEntityTraits().setLineWeight(AcDb::kLnWtByLayer);
			mode-&amp;gt;subEntityTraits().setTransparency(transparency);
			mode-&amp;gt;geometry().circle(AcGePoint3d::kOrigin, 500, normal);
		}

		if(pLayerTable-&amp;gt;getAt(_T("2"), idLayer) == Acad::eOk)
		{
			mode-&amp;gt;subEntityTraits().setLayer(idLayer);
			mode-&amp;gt;subEntityTraits().setLineWeight(AcDb::kLnWtByLayer);
			mode-&amp;gt;subEntityTraits().setTransparency(transparency);
			mode-&amp;gt;geometry().circle(AcGePoint3d::kOrigin, 400, normal);
		}

		if(pLayerTable-&amp;gt;getAt(_T("3"), idLayer) == Acad::eOk)
		{
			mode-&amp;gt;subEntityTraits().setLayer(idLayer);
			mode-&amp;gt;subEntityTraits().setLineWeight(AcDb::kLnWtByLayer);
			mode-&amp;gt;subEntityTraits().setTransparency(transparency);
			mode-&amp;gt;geometry().circle(AcGePoint3d::kOrigin, 300, normal);
		}

		if(pLayerTable-&amp;gt;getAt(_T("4"), idLayer) == Acad::eOk)
		{
			mode-&amp;gt;subEntityTraits().setLayer(idLayer);
			mode-&amp;gt;subEntityTraits().setLineWeight(AcDb::kLnWtByLayer);
			mode-&amp;gt;subEntityTraits().setTransparency(transparency);
			mode-&amp;gt;geometry().circle(AcGePoint3d::kOrigin, 200, normal);
		}

		if(pLayerTable-&amp;gt;getAt(_T("5"), idLayer) == Acad::eOk)
		{
			mode-&amp;gt;subEntityTraits().setLayer(idLayer);
			mode-&amp;gt;subEntityTraits().setLineWeight(AcDb::kLnWtByLayer);
			mode-&amp;gt;subEntityTraits().setTransparency(transparency);
			mode-&amp;gt;geometry().circle(AcGePoint3d::kOrigin, 100, normal);
		}
	}

	return (AcDbEntity::subWorldDraw (mode)) ;
}&lt;/PRE&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;hth.-&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2015 15:04:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acgisubentitytraits-setlayer-and-line-weight-transparency-and/m-p/5926213#M10597</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-26T15:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: AcGiSubEntityTraits::setLayer() and line weight, transparency and plottable</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acgisubentitytraits-setlayer-and-line-weight-transparency-and/m-p/5926282#M10598</link>
      <description>&lt;P&gt;Oh perfect, it works. I had not realized I had to do it after each &lt;EM&gt;setLayer()&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;And what about the &lt;EM&gt;plottable &lt;/EM&gt;property? Do you have an idea?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2015 15:54:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acgisubentitytraits-setlayer-and-line-weight-transparency-and/m-p/5926282#M10598</guid>
      <dc:creator>maisoui</dc:creator>
      <dc:date>2015-11-26T15:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: AcGiSubEntityTraits::setLayer() and line weight, transparency and plottable</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acgisubentitytraits-setlayer-and-line-weight-transparency-and/m-p/5926332#M10599</link>
      <description>&lt;P&gt;&lt;FONT face="courier new,courier"&gt;for the plottable part, i would do something like this, on each of the desired layers:&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;		if(pLayerTable-&amp;gt;getAt(_T("1"), idLayer) == Acad::eOk)
		{
			AcGiContext* context = mode-&amp;gt;context();
			if (context-&amp;gt;isPlotGeneration() == Adesk::kTrue)
			{
				AcDbLayerTableRecordPointer pLayer(idLayer, AcDb::kForRead);
				if (pLayer.openStatus() == Acad::eOk &amp;amp;&amp;amp; pLayer-&amp;gt;isPlottable()) 
				{
					mode-&amp;gt;subEntityTraits().setLayer(idLayer);
					mode-&amp;gt;subEntityTraits().setLineWeight(AcDb::kLnWtByLayer);
					mode-&amp;gt;subEntityTraits().setTransparency(transparency);
					mode-&amp;gt;geometry().circle(AcGePoint3d::kOrigin, 500, normal);
				}
			}
			else
			{
				mode-&amp;gt;subEntityTraits().setLayer(idLayer);
				mode-&amp;gt;subEntityTraits().setLineWeight(AcDb::kLnWtByLayer);
				mode-&amp;gt;subEntityTraits().setTransparency(transparency);
				mode-&amp;gt;geometry().circle(AcGePoint3d::kOrigin, 500, normal);
			}
		}&lt;/PRE&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;hth.-&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2015 16:45:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acgisubentitytraits-setlayer-and-line-weight-transparency-and/m-p/5926332#M10599</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-26T16:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: AcGiSubEntityTraits::setLayer() and line weight, transparency and plottable</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acgisubentitytraits-setlayer-and-line-weight-transparency-and/m-p/5926799#M10600</link>
      <description>&lt;P&gt;I thought of a solution like this. But It's a "manual approach". I think the API should manage it for me.&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2015 08:05:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acgisubentitytraits-setlayer-and-line-weight-transparency-and/m-p/5926799#M10600</guid>
      <dc:creator>maisoui</dc:creator>
      <dc:date>2015-11-27T08:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: AcGiSubEntityTraits::setLayer() and line weight, transparency and plottable</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acgisubentitytraits-setlayer-and-line-weight-transparency-and/m-p/5927251#M10601</link>
      <description>&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Yes, i used this in the past, and i see what you mean, as to why not currently the part of&amp;nbsp;mode-&amp;gt;subEntityTraits().setLayer(idLayer); does not takes care of updating the entity as (just for testing purposes), one can get by using AcGiDrawable's and get the effect without doing any of the&amp;nbsp;&lt;SPAN&gt;subEntityTraits().setXXXX calls.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;in example:&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;AcDbCircle* circle = new AcDbCircle(AcGePoint3d::kOrigin, normal, 500);	
circle-&amp;gt;setLayer(idLayer);
mode-&amp;gt;geometry().draw(circle);&lt;/PRE&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;even without testing for isPlotting()...&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2015 15:41:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acgisubentitytraits-setlayer-and-line-weight-transparency-and/m-p/5927251#M10601</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-27T15:41:14Z</dc:date>
    </item>
  </channel>
</rss>

