<?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: Adding trusted locations via DLL vb,net in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/adding-trusted-locations-via-dll-vb-net/m-p/4970706#M44419</link>
    <description>&lt;P&gt;Just adding in my two cents.&amp;nbsp; I've been working through the Options tabs to consolidate a 'stock' setting for our company.&amp;nbsp; This is what I have so far.&amp;nbsp; A few differences from what has been previously posted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    &amp;lt;CommandMethod("setconfig")&amp;gt; _
    Public Sub setconfig()
        Dim acpref As AcadPreferences = Application.Preferences
        Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
        Try
            'Misc Variables
            Application.SetSystemVariable("filedia", 1)
            Application.SetSystemVariable("gridmode", 0)
            Application.SetSystemVariable("copymode", 0)
            acDoc.Window.WindowState = Window.State.Maximized
            acpref.System.BeepOnError = False
            Application.SetSystemVariable("trustedpaths", ";C:\Forum_ACAD\2014\;" &amp;amp; ";R:\2014\;")

            'Files
            acpref.Files.SupportPath = ";C:\Forum_ACAD\2014\" &amp;amp; ";R:\2014\;" &amp;amp; acpref.Files.SupportPath

            'acpref.Files.EnterpriseMenuFile = "R:\2014\Menus\Forum-2014.cuix"
            acpref.Files.PrinterConfigPath = "R:\2014\Plotters\"

            acpref.Files.PrinterDescPath = "R:\2014\Plotters\"
            acpref.Files.PrintSpoolerPath = "C:\Temp\"
            acpref.Files.PrinterStyleSheetPath = "R:\2014\Plotters\"

            acpref.Files.TemplateDwgPath = "R:\2014\Templates\"
            acpref.Files.QNewTemplateFile = "R:\2014\Templates\file-types.dwt"

            acpref.Files.TempFilePath = "C:\Temp\"

            'Display
            acpref.Display.DisplayScrollBars = False
            acpref.Display.XRefFadeIntensity = 50
            acpref.Display.GraphicsWinModelBackgrndColor = 0
            acpref.Display.CursorSize = 100
            acpref.Display.LayoutDisplayPaperShadow = False
            'acpref.Display.ModelCrosshairColor = "Color 42"

            'Open Save
            acpref.OpenSave.SaveAsType = Autodesk.AutoCAD.Interop.Common.AcSaveAsType.ac2013_dwg
            acpref.OpenSave.SavePreviewThumbnail = False
            acpref.OpenSave.AutoSaveInterval = False
            acpref.OpenSave.IncrementalSavePercent = 0
            acpref.OpenSave.CreateBackup = False
            acpref.OpenSave.FullCRCValidation = True
            acpref.OpenSave.LogFileOn = False
            acpref.OpenSave.MRUNumber.Equals("10")
            acpref.OpenSave.DemandLoadARXApp = Autodesk.AutoCAD.Interop.Common.AcARXDemandLoad.acDemandLoadOnObjectDetect
            acpref.OpenSave.AutoAudit = True
            acpref.OpenSave.ShowProxyDialogBox = False
            acpref.OpenSave.TempFileExtension = "ac$"
            acpref.OpenSave.XrefDemandLoad = Autodesk.AutoCAD.Interop.Common.AcXRefDemandLoad.acDemandLoadEnabled
            acpref.OpenSave.ProxyImage = False

            ''Plot and Publish
            acpref.Output.AutomaticPlotLog = False
            acpref.Output.ContinuousPlotLog = False
            acpref.Output.DefaultOutputDevice = "Adobe PDF"
            Application.SetSystemVariable("BackGroundPlot", 0)
            Application.SetSystemVariable("AutomaticPub", 0)

            ''Drafting
            acpref.Drafting.AutoTrackTooltip = False
            acpref.Drafting.AutoSnapTooltip = False
            acpref.Drafting.AlignmentPointAcquisition = 0
        Catch ex As Exception
        End Try
    End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 18 Apr 2014 13:28:30 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-04-18T13:28:30Z</dc:date>
    <item>
      <title>Adding trusted locations via DLL vb,net</title>
      <link>https://forums.autodesk.com/t5/net-forum/adding-trusted-locations-via-dll-vb-net/m-p/4960848#M44417</link>
      <description>&lt;P&gt;I have got a lsp that add's the trusted location's to autocad if the version of autocad that is running is 2014 or above&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(if (&amp;gt;= (getvar "ACADVER") "19.1")
(setvar "trustedpaths" (strcat (getvar "trustedpaths")
"c:\\folder1;"
"c:\\folder2;"
"c:\\folder3;"
"c:\\folder4;"
)))&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would i be able to add that to my DLL to check if the trusted locations were already there if not to add them ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Apr 2014 13:58:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/adding-trusted-locations-via-dll-vb-net/m-p/4960848#M44417</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-04-15T13:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: Adding trusted locations via DLL vb,net</title>
      <link>https://forums.autodesk.com/t5/net-forum/adding-trusted-locations-via-dll-vb-net/m-p/4961048#M44418</link>
      <description>&lt;P&gt;Same method that we used for&lt;A target="_blank" href="https://forums.autodesk.com/t5/NET/Add-Support-paths-via-DLL-vb-net/m-p/4960490#M40167"&gt; Support path.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; Public Sub gettrust()
        Dim str_TR As String = Autodesk.AutoCAD.ApplicationServices.Application.GetSystemVariable("TRUSTEDPATHS")

        Dim C_Paths As String = LCase(str_TR)

        Dim Old_Path_Ary As List(Of String) = New List(Of String)
        Old_Path_Ary = C_Paths.Split(";").ToList

        Dim New_paths As List(Of String) = New List(Of String)

        New_paths.Add("C:\Program files\Folder1")
        New_paths.Add("C:\Program files\Folder2")
        New_paths.Add("C:\Program files\Folder3")
        New_paths.Add("C:\Program files\Folder4")

        For Each Str As String In New_paths
            If Not Old_Path_Ary.Contains(LCase(Str)) Then
                Old_Path_Ary.Add(Str)
            End If
        Next

        Autodesk.AutoCAD.ApplicationServices.Application.SetSystemVariable("TRUSTEDPATHS", String.Join(";", Old_Path_Ary.ToArray()))
        
    End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Apr 2014 15:11:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/adding-trusted-locations-via-dll-vb-net/m-p/4961048#M44418</guid>
      <dc:creator>Ajilal.Vijayan</dc:creator>
      <dc:date>2014-04-15T15:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Adding trusted locations via DLL vb,net</title>
      <link>https://forums.autodesk.com/t5/net-forum/adding-trusted-locations-via-dll-vb-net/m-p/4970706#M44419</link>
      <description>&lt;P&gt;Just adding in my two cents.&amp;nbsp; I've been working through the Options tabs to consolidate a 'stock' setting for our company.&amp;nbsp; This is what I have so far.&amp;nbsp; A few differences from what has been previously posted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    &amp;lt;CommandMethod("setconfig")&amp;gt; _
    Public Sub setconfig()
        Dim acpref As AcadPreferences = Application.Preferences
        Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
        Try
            'Misc Variables
            Application.SetSystemVariable("filedia", 1)
            Application.SetSystemVariable("gridmode", 0)
            Application.SetSystemVariable("copymode", 0)
            acDoc.Window.WindowState = Window.State.Maximized
            acpref.System.BeepOnError = False
            Application.SetSystemVariable("trustedpaths", ";C:\Forum_ACAD\2014\;" &amp;amp; ";R:\2014\;")

            'Files
            acpref.Files.SupportPath = ";C:\Forum_ACAD\2014\" &amp;amp; ";R:\2014\;" &amp;amp; acpref.Files.SupportPath

            'acpref.Files.EnterpriseMenuFile = "R:\2014\Menus\Forum-2014.cuix"
            acpref.Files.PrinterConfigPath = "R:\2014\Plotters\"

            acpref.Files.PrinterDescPath = "R:\2014\Plotters\"
            acpref.Files.PrintSpoolerPath = "C:\Temp\"
            acpref.Files.PrinterStyleSheetPath = "R:\2014\Plotters\"

            acpref.Files.TemplateDwgPath = "R:\2014\Templates\"
            acpref.Files.QNewTemplateFile = "R:\2014\Templates\file-types.dwt"

            acpref.Files.TempFilePath = "C:\Temp\"

            'Display
            acpref.Display.DisplayScrollBars = False
            acpref.Display.XRefFadeIntensity = 50
            acpref.Display.GraphicsWinModelBackgrndColor = 0
            acpref.Display.CursorSize = 100
            acpref.Display.LayoutDisplayPaperShadow = False
            'acpref.Display.ModelCrosshairColor = "Color 42"

            'Open Save
            acpref.OpenSave.SaveAsType = Autodesk.AutoCAD.Interop.Common.AcSaveAsType.ac2013_dwg
            acpref.OpenSave.SavePreviewThumbnail = False
            acpref.OpenSave.AutoSaveInterval = False
            acpref.OpenSave.IncrementalSavePercent = 0
            acpref.OpenSave.CreateBackup = False
            acpref.OpenSave.FullCRCValidation = True
            acpref.OpenSave.LogFileOn = False
            acpref.OpenSave.MRUNumber.Equals("10")
            acpref.OpenSave.DemandLoadARXApp = Autodesk.AutoCAD.Interop.Common.AcARXDemandLoad.acDemandLoadOnObjectDetect
            acpref.OpenSave.AutoAudit = True
            acpref.OpenSave.ShowProxyDialogBox = False
            acpref.OpenSave.TempFileExtension = "ac$"
            acpref.OpenSave.XrefDemandLoad = Autodesk.AutoCAD.Interop.Common.AcXRefDemandLoad.acDemandLoadEnabled
            acpref.OpenSave.ProxyImage = False

            ''Plot and Publish
            acpref.Output.AutomaticPlotLog = False
            acpref.Output.ContinuousPlotLog = False
            acpref.Output.DefaultOutputDevice = "Adobe PDF"
            Application.SetSystemVariable("BackGroundPlot", 0)
            Application.SetSystemVariable("AutomaticPub", 0)

            ''Drafting
            acpref.Drafting.AutoTrackTooltip = False
            acpref.Drafting.AutoSnapTooltip = False
            acpref.Drafting.AlignmentPointAcquisition = 0
        Catch ex As Exception
        End Try
    End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2014 13:28:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/adding-trusted-locations-via-dll-vb-net/m-p/4970706#M44419</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-04-18T13:28:30Z</dc:date>
    </item>
  </channel>
</rss>

