<?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: transparancy viewportoverride in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/transparancy-viewportoverride/m-p/3329297#M57287</link>
    <description>&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;When i use new ...colors.transparency(127)&amp;nbsp; visual studio gives me an error. (see attachement 1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i tried to replace 127 with an byte-value and visual studio gives me another error. (see attachement 2)&lt;/P&gt;</description>
    <pubDate>Mon, 13 Feb 2012 08:08:09 GMT</pubDate>
    <dc:creator>erik_kohl</dc:creator>
    <dc:date>2012-02-13T08:08:09Z</dc:date>
    <item>
      <title>transparancy viewportoverride</title>
      <link>https://forums.autodesk.com/t5/net-forum/transparancy-viewportoverride/m-p/3326767#M57285</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone how to make a layer&amp;nbsp;or an entity transparant within a viewport?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I figured out the following code found in:&lt;/P&gt;&lt;P&gt;&lt;A href="http://through-the-interface.typepad.com/through_the_interface/2010/06/creating-transparent-hatches-in-autocad-using-net.html" target="_blank"&gt;http://through-the-interface.typepad.com/through_the_interface/2010/06/creating-transparent-hatches-in-autocad-using-net.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It&amp;nbsp;gives an error at &lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;New &lt;/FONT&gt;&lt;/FONT&gt;Autodesk.AutoCAD.Colors.Transparency(127)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;Using&lt;/FONT&gt;&lt;/FONT&gt; transactie &lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;As&lt;/FONT&gt;&lt;/FONT&gt;Transaction = DWG.TransactionManager.StartTransaction&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;Dim&lt;/FONT&gt;&lt;/FONT&gt; Layertable &lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;As&lt;/FONT&gt;&lt;/FONT&gt;LayerTable = DWG.LayerTableId.GetObject(OpenMode.ForRead)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;Dim&lt;/FONT&gt;&lt;/FONT&gt; VP &lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;As&lt;/FONT&gt;&lt;/FONT&gt;Viewport = transactie.GetObject(Doc.Editor.CurrentViewportObjectId, OpenMode.ForWrite)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;Dim&lt;/FONT&gt;&lt;/FONT&gt; LVPO &lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;As&lt;/FONT&gt;&lt;/FONT&gt;LayerViewportProperties&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;For&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;Each&lt;/FONT&gt;&lt;/FONT&gt; LayerID &lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;In &lt;/FONT&gt;&lt;/FONT&gt;Layertable&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;Dim&lt;/FONT&gt;&lt;/FONT&gt; LaagTabelRec &lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;As&lt;/FONT&gt;&lt;/FONT&gt;LayerTableRecord = transactie.GetObject(LayerID, OpenMode.ForRead)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;LVPO = LaagTabelRec.GetViewportOverrides(VP.Id)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;LVPO.Transparency = &lt;/FONT&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;New &lt;/FONT&gt;&lt;/FONT&gt;Autodesk.AutoCAD.Colors.Transparency(127)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="arial,helvetica,sans-serif" size="1"&gt;&lt;FONT color="#0000ff"&gt;Next&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="1"&gt;transactie.Commit()&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="1"&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;End&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;Using&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2012 12:54:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/transparancy-viewportoverride/m-p/3326767#M57285</guid>
      <dc:creator>erik_kohl</dc:creator>
      <dc:date>2012-02-10T12:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: transparancy viewportoverride</title>
      <link>https://forums.autodesk.com/t5/net-forum/transparancy-viewportoverride/m-p/3328963#M57286</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the following code and for me it does not interrupt at the line for setting the layer-override-transparency ..... as long as I have a layout active and I'm IN a viewport &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Of course it crashes if I have the tab "Model Space" active (so I don't have a layout active)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;   &amp;lt;Runtime.CommandMethod("ADESK_VPLayerTransparency")&amp;gt; _
   Public Shared Sub ADESK_VPLayerTransparency()
      Dim tDwg As ApplicationServices.Document = ApplicationServices.Application.DocumentManager.MdiActiveDocument
      Dim tDwgLock As ApplicationServices.DocumentLock = Nothing
      Try
         tDwgLock = tDwg.LockDocument
         Using transactie As DatabaseServices.Transaction = tDwg.TransactionManager.StartTransaction

            Dim Layertable As DatabaseServices.LayerTable = CType(transactie.GetObject(tDwg.Database.LayerTableId, DatabaseServices.OpenMode.ForRead), DatabaseServices.LayerTable)
            Dim LVPO As DatabaseServices.LayerViewportProperties

            For Each LayerID As DatabaseServices.ObjectId In Layertable
               Dim LaagTabelRec As DatabaseServices.LayerTableRecord = CType(transactie.GetObject(LayerID, DatabaseServices.OpenMode.ForWrite), DatabaseServices.LayerTableRecord)
               LVPO = LaagTabelRec.GetViewportOverrides(tDwg.Editor.CurrentViewportObjectId)
               LVPO.Transparency = New Autodesk.AutoCAD.Colors.Transparency(127)
            Next

            transactie.Commit()
         End Using
      Catch ex As Exception
         Call MsgBox("Unknown error in 'ADESK_VPLayerTransparency'" &amp;amp; vbNewLine &amp;amp; ex.Message)
      Finally
         If tDwgLock IsNot Nothing Then tDwgLock.Dispose() : tDwgLock = Nothing
      End Try
   End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HTH, - alfred -&lt;/P&gt;</description>
      <pubDate>Sun, 12 Feb 2012 20:20:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/transparancy-viewportoverride/m-p/3328963#M57286</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2012-02-12T20:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: transparancy viewportoverride</title>
      <link>https://forums.autodesk.com/t5/net-forum/transparancy-viewportoverride/m-p/3329297#M57287</link>
      <description>&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;When i use new ...colors.transparency(127)&amp;nbsp; visual studio gives me an error. (see attachement 1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i tried to replace 127 with an byte-value and visual studio gives me another error. (see attachement 2)&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2012 08:08:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/transparancy-viewportoverride/m-p/3329297#M57287</guid>
      <dc:creator>erik_kohl</dc:creator>
      <dc:date>2012-02-13T08:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: transparancy viewportoverride</title>
      <link>https://forums.autodesk.com/t5/net-forum/transparancy-viewportoverride/m-p/3329317#M57288</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what version of AutoCAD do you use? I tried it with 2012(64bit) and Option Strict ON, and I don't get a message, neither during code-writing nor during runtime.&lt;/P&gt;&lt;P&gt;Could you try:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#666699" face="lucida sans unicode,lucida sans"&gt;LVPO.Transparency = New Autodesk.AutoCAD.Colors.Transparency(&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;CByte(127)&lt;/FONT&gt;&lt;/STRONG&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- alfred -&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2012 08:33:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/transparancy-viewportoverride/m-p/3329317#M57288</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2012-02-13T08:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: transparancy viewportoverride</title>
      <link>https://forums.autodesk.com/t5/net-forum/transparancy-viewportoverride/m-p/3329321#M57289</link>
      <description>&lt;P&gt;I use autocad 2011 64bit with visual studio 2008.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i tried Cbyte(127) and that did the trick!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2012 08:38:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/transparancy-viewportoverride/m-p/3329321#M57289</guid>
      <dc:creator>erik_kohl</dc:creator>
      <dc:date>2012-02-13T08:38:12Z</dc:date>
    </item>
  </channel>
</rss>

