<?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 : Linetype question in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/linetype-question/m-p/5594490#M40505</link>
    <description>&lt;P&gt;I think I added your codes correctly but I need to load "HIDDEN" linetype if it is not already loaded , how to do that ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; Dim ltt As LinetypeTable
                ltt = acTrans.GetObject(acCurDb.LinetypeTableId, OpenMode.ForRead)
                If (ltt.Has("HIDDEN")) Then
                    acLine.Linetype = "HIDDEN"&lt;BR /&gt;&lt;FONT color="#ff0000"&gt;                   Else ......&lt;/FONT&gt;
                End If&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Thank you&lt;/P&gt;</description>
    <pubDate>Thu, 16 Apr 2015 06:58:06 GMT</pubDate>
    <dc:creator>J-Rocks</dc:creator>
    <dc:date>2015-04-16T06:58:06Z</dc:date>
    <item>
      <title>Linetype question</title>
      <link>https://forums.autodesk.com/t5/net-forum/linetype-question/m-p/5594384#M40502</link>
      <description>&lt;P&gt;Hello guys&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wonder how to change or set the Line type of line object in my codes below .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Dim acLine As Line = New Line(New Point3d(0, 0, 0), New Point3d(12, 3, 0))
                acLine.SetDatabaseDefaults()
                acLine.ColorIndex = 1&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Can someone help me and explain the way to get that working ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2015 05:22:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/linetype-question/m-p/5594384#M40502</guid>
      <dc:creator>J-Rocks</dc:creator>
      <dc:date>2015-04-16T05:22:11Z</dc:date>
    </item>
    <item>
      <title>Re : Linetype question</title>
      <link>https://forums.autodesk.com/t5/net-forum/linetype-question/m-p/5594448#M40503</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just set the linetype property of the entity:&lt;/P&gt;
&lt;PRE&gt;acLine.Linetype = "HIDDEN";&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;but you'd rather check if the line type is loaded before.&lt;/P&gt;
&lt;PRE&gt;LinetypeTable ltt =
    (LinetypeTable)tr.GetObject(db.LinetypeTableId, OpenMode.ForRead);
if (ltt.Has("HIDDEN"))
    acLine.Linetype = "HIDDEN";&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2015 06:26:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/linetype-question/m-p/5594448#M40503</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2015-04-16T06:26:27Z</dc:date>
    </item>
    <item>
      <title>Re : Linetype question</title>
      <link>https://forums.autodesk.com/t5/net-forum/linetype-question/m-p/5594461#M40504</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you gile .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am sorry I am a new with VB.net and C# .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added your codes into the program but I failed . Can you please just include your codes in&amp;nbsp;my prorgam ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Public Class rocks
        &amp;lt;CommandMethod("AddLine")&amp;gt;
        Public Sub AddLine()
            '' Get the current document and database
            Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
            Dim acCurDb As Database = acDoc.Database
            '' Start a transaction
            Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction()
                '' Open the Block table for read
                Dim acBlkTbl As BlockTable
                acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId, OpenMode.ForRead)
                '' Open the Block table record Model space for write
                Dim acBlkTblRec As BlockTableRecord
                acBlkTblRec = acTrans.GetObject(acBlkTbl(BlockTableRecord.ModelSpace),
                                                                       OpenMode.ForWrite)
                Dim acLine As Line = New Line(New Point3d(0, 0, 0), New Point3d(12, 3, 0))
                acLine.SetDatabaseDefaults()
                acLine.ColorIndex = 1
                'acLine.Linetype = 
                acLine.LineWeight = LineWeight.LineWeight040
                '' Add the new object to the block table record and the transaction
                acBlkTblRec.AppendEntity(acLine)
                acTrans.AddNewlyCreatedDBObject(acLine, True)
                '' Save the new object to the database
                acTrans.Commit()
            End Using
        End Sub
    End Class&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you very much.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2015 06:41:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/linetype-question/m-p/5594461#M40504</guid>
      <dc:creator>J-Rocks</dc:creator>
      <dc:date>2015-04-16T06:41:38Z</dc:date>
    </item>
    <item>
      <title>Re : Linetype question</title>
      <link>https://forums.autodesk.com/t5/net-forum/linetype-question/m-p/5594490#M40505</link>
      <description>&lt;P&gt;I think I added your codes correctly but I need to load "HIDDEN" linetype if it is not already loaded , how to do that ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; Dim ltt As LinetypeTable
                ltt = acTrans.GetObject(acCurDb.LinetypeTableId, OpenMode.ForRead)
                If (ltt.Has("HIDDEN")) Then
                    acLine.Linetype = "HIDDEN"&lt;BR /&gt;&lt;FONT color="#ff0000"&gt;                   Else ......&lt;/FONT&gt;
                End If&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2015 06:58:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/linetype-question/m-p/5594490#M40505</guid>
      <dc:creator>J-Rocks</dc:creator>
      <dc:date>2015-04-16T06:58:06Z</dc:date>
    </item>
    <item>
      <title>Re : Linetype question</title>
      <link>https://forums.autodesk.com/t5/net-forum/linetype-question/m-p/5594600#M40506</link>
      <description>&lt;P&gt;You can try (not sure about VB syntax):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;If Not ltt.Has("HIDDEN") Then
    acCurDb.LoadLineTypeFile("HIDDEN", "acad.lin")
End If
acLine.Linetype = "HIDDEN"&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;You may have a look to &lt;A href="http://help.autodesk.com/view/ACD/2016/ENU/?guid=GUID-81423588-A182-4511-B9D3-115014C96BCE" target="_blank"&gt;&lt;STRONG&gt;the docs&lt;/STRONG&gt;&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2015 08:55:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/linetype-question/m-p/5594600#M40506</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2015-04-16T08:55:52Z</dc:date>
    </item>
    <item>
      <title>Re : Linetype question</title>
      <link>https://forums.autodesk.com/t5/net-forum/linetype-question/m-p/5594726#M40507</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous_gile wrote:&lt;BR /&gt;&lt;P&gt;You can try (not sure about VB syntax):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;If Not ltt.Has("HIDDEN") Then
    acCurDb.LoadLineTypeFile("HIDDEN", "acad.lin")
End If
acLine.Linetype = "HIDDEN"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;You may have a look to &lt;A href="http://help.autodesk.com/view/ACD/2016/ENU/?guid=GUID-81423588-A182-4511-B9D3-115014C96BCE" target="_blank"&gt;&lt;STRONG&gt;the docs&lt;/STRONG&gt;&lt;/A&gt;.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;That works very well , thank you Gile for your great help .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and thanks for the link that helps much to understand the complete process .&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2015 10:26:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/linetype-question/m-p/5594726#M40507</guid>
      <dc:creator>J-Rocks</dc:creator>
      <dc:date>2015-04-16T10:26:33Z</dc:date>
    </item>
  </channel>
</rss>

