<?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: Set DWG Properties (will not show) in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/set-dwg-properties-will-not-show/m-p/10408069#M16015</link>
    <description>&lt;P&gt;This is what I have been using for a few years now:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;    Public Function Dwgprops() As DatabaseSummaryInfo
        Dim builder As New DatabaseSummaryInfoBuilder With {
            .Title = "Title",
            .Subject = "Subject",
            .Author = "Author",
            .Keywords = "Keywords",
            .HyperlinkBase = "www.hyperlink.com",
            .Comments = "Comments"
        }

        Return builder.ToDatabaseSummaryInfo()

    End Function&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The function is called by this command:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;    &amp;lt;Autodesk.AutoCAD.Runtime.CommandMethod("PROPS", CommandFlags.Modal)&amp;gt; Public Sub PROPS()
        Dim doc As Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument
        Dim db As Database = doc.Database
        
        db.SummaryInfo = Dwgprops()

    End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks mostly the same as your method. But maybe you could try this?&lt;/P&gt;</description>
    <pubDate>Mon, 21 Jun 2021 14:18:26 GMT</pubDate>
    <dc:creator>R.Gerritsen4967</dc:creator>
    <dc:date>2021-06-21T14:18:26Z</dc:date>
    <item>
      <title>Set DWG Properties (will not show)</title>
      <link>https://forums.autodesk.com/t5/net-forum/set-dwg-properties-will-not-show/m-p/10407765#M16014</link>
      <description>&lt;P&gt;hi !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want to set dwg properties. i found following example: &lt;A href="https://adndevblog.typepad.com/autocad/2012/05/writing-autocad-drawing-summary-information.html" target="_blank"&gt;https://adndevblog.typepad.com/autocad/2012/05/writing-autocad-drawing-summary-information.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i create following function for this job in a seperate class&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;''' &amp;lt;summary&amp;gt;
    ''' schreiben von vordefinierten Eigenschaften
    ''' &amp;lt;/summary&amp;gt;
    ''' &amp;lt;param name="Titel"&amp;gt;optional Titel der Zeichnung (default:= Leerstring - keine Übernahme)&amp;lt;/param&amp;gt;
    ''' &amp;lt;param name="Thema"&amp;gt;optional Thema der Zeichnung (default:= Leerstring - keine Übernahme)&amp;lt;/param&amp;gt;
    ''' &amp;lt;param name="Verfasser"&amp;gt;optional Verfasser der Zeichnung (default:= Leerstring - keine Übernahme)&amp;lt;/param&amp;gt;
    ''' &amp;lt;param name="Kommentar"&amp;gt;optional Kommentar (default:= Leerstring - keine Übernahme)&amp;lt;/param&amp;gt;
    ''' &amp;lt;param name="Schlüssel"&amp;gt;optional Schlüsselworte für die Suche (default:= Leerstring - keine Übernahme)&amp;lt;/param&amp;gt;
    ''' &amp;lt;param name="HyperBase"&amp;gt;optional Basis für eingefügte Hyperlinks (default:= Leerstring - keine Übernahme)&amp;lt;/param&amp;gt;
    ''' &amp;lt;remarks&amp;gt;es erfolgt keine Prüfung, ob bereits Werte vorhanden sind&amp;lt;/remarks&amp;gt;
    Public Sub Write(Optional Titel As String = "",
                     Optional Thema As String = "",
                     Optional Verfasser As String = "",
                     Optional Kommentar As String = "",
                     Optional Schlüssel As String = "",
                     Optional HyperBase As String = "")
        '------ https://adndevblog.typepad.com/autocad/2012/05/writing-autocad-drawing-summary-information.html ------
        Dim Editor As Autodesk.AutoCAD.EditorInput.Editor
        Dim acDoc As Autodesk.AutoCAD.ApplicationServices.Document
        Dim AcDb As Autodesk.AutoCAD.DatabaseServices.Database

        acDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument
        Editor = acDoc.Editor
        AcDb = acDoc.Database

        Editor.WriteMessage("standard Zeichnungseigenschaften setzen/ändern" &amp;amp; vbCrLf)

        Dim infobuilder As DatabaseSummaryInfoBuilder = New DatabaseSummaryInfoBuilder(AcDb.SummaryInfo)
        Dim info As DatabaseSummaryInfo = infobuilder.ToDatabaseSummaryInfo

        Try
            Dim docLock As DocumentLock = acDoc.LockDocument
            Using docLock

                If Titel.Length &amp;gt; 0 Then infobuilder.Title = Titel
                If Thema.Length &amp;gt; 0 Then infobuilder.Subject = Thema
                If Verfasser.Length &amp;gt; 0 Then infobuilder.Author = Verfasser
                If Kommentar.Length &amp;gt; 0 Then infobuilder.Comments = Kommentar
                If Schlüssel.Length &amp;gt; 0 Then infobuilder.Keywords = Schlüssel
                If HyperBase.Length &amp;gt; 0 Then infobuilder.HyperlinkBase = HyperBase

                AcDb.SummaryInfo = info
            End Using 'docLock
            Try
                Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor.Regen()
            Catch ex As System.Exception
                _Log?.WriteAsError("unerwarteter Fehler in EBL.Acad &amp;gt; Properties &amp;gt; Write" &amp;amp; Environment.NewLine &amp;amp; ex.ToString, ShowInfoDialog:=True)
            End Try

        Catch ex As System.Exception
            _Log?.WriteAsError("Fehler beim Zuweisen einer Zeichnungseigenschaft!" &amp;amp; Environment.NewLine &amp;amp; ex.ToString, ShowInfoDialog:=True)
        End Try


    End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i called by following in a existing (normally unsaved drawing)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim acDocMgr As DocumentCollection = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager
                Dim acDoc As Autodesk.AutoCAD.ApplicationServices.Document = acDocMgr.MdiActiveDocument
                Dim strDWGName As String = acDoc.Name

                Dim obj As Object = Autodesk.AutoCAD.ApplicationServices.Application.GetSystemVariable("DWGTITLED")

                '2017-07-12 Tap - Speichern umbelenkt
                Dim ErrText As String = ""
                If _AcadServ.AcSaveAsVersion(NeuerDWGName, acDoc, ErrText, True) = False Then
                    MessageBox.Show("Fehler beim Speichern der Datei!" &amp;amp; Environment.NewLine &amp;amp; Environment.NewLine &amp;amp; ErrText, k_AppName_AllgDWGSave, MessageBoxButtons.OK, MessageBoxIcon.Hand)
                    Exit Sub
                End If

                ' schreiben der Zeichnungseigenschaften
                Dim fProperties As New EBL.Acad.Properties()
                With fProperties
                    .VerfasserEbl()
                    .Write(Titel:=DWG_Titel, Thema:=DWG_Thema, Kommentar:="DWG erstellt am: " &amp;amp; DateTime.Now.ToString("dd.MM.yyyy"))
                End With&lt;/LI-CODE&gt;&lt;P&gt;the file is open and when i current look into the properties-manager there are no values!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in debug-mode there will the values show in infobuilder-variable&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-06-21_14h55_28.png" style="width: 932px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/932640i292D4667F62488F2/image-size/large?v=v2&amp;amp;px=999" role="button" title="2021-06-21_14h55_28.png" alt="2021-06-21_14h55_28.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;could someone help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards Jan&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 12:56:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/set-dwg-properties-will-not-show/m-p/10407765#M16014</guid>
      <dc:creator>jan_tappenbeck</dc:creator>
      <dc:date>2021-06-21T12:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Set DWG Properties (will not show)</title>
      <link>https://forums.autodesk.com/t5/net-forum/set-dwg-properties-will-not-show/m-p/10408069#M16015</link>
      <description>&lt;P&gt;This is what I have been using for a few years now:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;    Public Function Dwgprops() As DatabaseSummaryInfo
        Dim builder As New DatabaseSummaryInfoBuilder With {
            .Title = "Title",
            .Subject = "Subject",
            .Author = "Author",
            .Keywords = "Keywords",
            .HyperlinkBase = "www.hyperlink.com",
            .Comments = "Comments"
        }

        Return builder.ToDatabaseSummaryInfo()

    End Function&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The function is called by this command:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;    &amp;lt;Autodesk.AutoCAD.Runtime.CommandMethod("PROPS", CommandFlags.Modal)&amp;gt; Public Sub PROPS()
        Dim doc As Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument
        Dim db As Database = doc.Database
        
        db.SummaryInfo = Dwgprops()

    End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks mostly the same as your method. But maybe you could try this?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 14:18:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/set-dwg-properties-will-not-show/m-p/10408069#M16015</guid>
      <dc:creator>R.Gerritsen4967</dc:creator>
      <dc:date>2021-06-21T14:18:26Z</dc:date>
    </item>
  </channel>
</rss>

