Bake curve with different line types with C# - Grasshopper2024-03-28T23:45:36Zhttps://www.grasshopper3d.com/forum/topics/bake-curve-with-different-line-types-with-c?feed=yes&xn_auth=noIt worked. Thanks a lot.tag:www.grasshopper3d.com,2017-11-01:2985220:Comment:18449872017-11-01T18:19:22.544ZAdrián Juárez Monroyhttps://www.grasshopper3d.com/profile/AdrianJuarezMonroy
<p>It worked. Thanks a lot.</p>
<p>It worked. Thanks a lot.</p> Make sure you also set the Li…tag:www.grasshopper3d.com,2017-11-01:2985220:Comment:18450742017-11-01T17:29:55.922ZAndrew Heumannhttps://www.grasshopper3d.com/profile/AndrewHeumann
<p>Make sure you also set the LinetypeSource property to be ObjectLinetypeSource.<span>LinetypeFromObject</span>, otherwise it will continue to use the by-layer setting. </p>
<p>Make sure you also set the LinetypeSource property to be ObjectLinetypeSource.<span>LinetypeFromObject</span>, otherwise it will continue to use the by-layer setting. </p> Thanks for answering.
I check…tag:www.grasshopper3d.com,2017-11-01:2985220:Comment:18446232017-11-01T03:23:51.391ZAdrián Juárez Monroyhttps://www.grasshopper3d.com/profile/AdrianJuarezMonroy
<p>Thanks for answering.</p>
<p>I checked the document properties and it has some linetypes by default</p>
<p></p>
<p><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769342145?profile=original" target="_self"><img class="align-full" src="http://storage.ning.com/topology/rest/1.0/file/get/2769342145?profile=RESIZE_1024x1024" width="721"></img></a></p>
<p>Then I did this</p>
<p></p>
<blockquote><p><strong><span style="font-family: courier new,courier;">ObjectAttributes attr = RhinoDocument.CreateDefaultAttributes();…</span></strong></p>
<p></p>
</blockquote>
<p>Thanks for answering.</p>
<p>I checked the document properties and it has some linetypes by default</p>
<p></p>
<p><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769342145?profile=original" target="_self"><img width="721" src="http://storage.ning.com/topology/rest/1.0/file/get/2769342145?profile=RESIZE_1024x1024" class="align-full" width="721"/></a></p>
<p>Then I did this</p>
<p></p>
<blockquote><p><strong><span style="font-family: courier new,courier;">ObjectAttributes attr = RhinoDocument.CreateDefaultAttributes();</span></strong></p>
<p><strong><span style="font-family: courier new,courier;">attr.LinetypeIndex = doc.Linetypes.Find("Puntos", true);</span></strong></p>
<p><strong><span style="font-family: courier new,courier;">doc.Objects.AddCurve(curve, attr);</span></strong></p>
</blockquote>
<p></p>
<p>but it doesn't have any effect (the value of <strong><span style="font-family: courier new,courier;">doc</span><span style="font-family: courier new,courier;">.</span><span style="font-family: courier new,courier;">Linetypes</span><span style="font-family: courier new,courier;">.Find("Puntos", true)</span></strong> is <strong><span style="font-family: courier new,courier;">5</span></strong>). When I see the properties of the curve, in the linetype it says by layer.</p>
<p></p>
<p>When I bake the curve to a layer with this</p>
<p></p>
<blockquote><p><strong><span style="font-family: courier new,courier;">ObjectAttributes attr = RhinoDocument.CreateDefaultAttributes();</span></strong></p>
<p><strong><span style="font-family: courier new,courier;">attr.LayerIndex = doc.Layers.Find("Layer01", true);</span></strong></p>
<p><strong><span style="font-family: courier new,courier;">doc.Objects.AddCurve(curve, attr);</span></strong></p>
<p></p>
</blockquote>
<p>it does it right, but when I change the linetype, it doesn't do it.</p> The LinetypeIndex refers to t…tag:www.grasshopper3d.com,2017-10-31:2985220:Comment:18443502017-10-31T23:59:22.335ZDavid Ruttenhttps://www.grasshopper3d.com/profile/DavidRutten
<p>The LinetypeIndex refers to the LineTypeTable in the loaded 3dm file. If you pick an index which doesn't exist you'll see no linetypes. However even if you pick an index which does exist it still depends on the display mode whether or not the dashes are visible instead of the solid curve. Try toggling the _PrintDisplay command to see if it's just a matter of Rhino display.</p>
<p>The LinetypeIndex refers to the LineTypeTable in the loaded 3dm file. If you pick an index which doesn't exist you'll see no linetypes. However even if you pick an index which does exist it still depends on the display mode whether or not the dashes are visible instead of the solid curve. Try toggling the _PrintDisplay command to see if it's just a matter of Rhino display.</p>