Results 1 to 2 of 2

Thread: Create Custom Drawing Properties that keep the case of the string given?

  1. #1
    I could stop if I wanted to
    Join Date
    2003-03
    Location
    Alberta
    Posts
    260
    Login to Give a bone
    0

    Default Create Custom Drawing Properties that keep the case of the string given?

    How can I create Custom Drawing Properties that keep the case of the string given?

    I have a function that modifies the custom properties of a drawing to add a new property with a given value. My problem is that when the property is added the name is always created using lower case. This is a problem because I have another routine that creates text to show the values of the drawing properties and the field codes are expecting case sensitive names.

    Here's a snippet of my code to create the custom property.
    Code:
    Dim Builder As New AcadDb.DatabaseSummaryInfoBuilder(Dwg.Database.SummaryInfo)
    Dim Name as String = "My Prop"
    Builder.CustomProperties.Add(Name, Value)
    When I look in the Custom Properties "My Prop" has changed to "my prop". What's going on?

  2. #2
    I could stop if I wanted to
    Join Date
    2003-03
    Location
    Alberta
    Posts
    260
    Login to Give a bone
    0

    Exclamation Re: Create Custom Drawing Properties that keep the case of the string given?

    OK, the problem is bigger then I thought. When I use the ToDatabaseSummaryInfo method from Builder to update the drawing, all of the Custom Property keys are changed to lower case. This wreaks havoc across my drawing as any fields now show the #### as they are looking for the Cased Key Names.

    Here's my complete function.
    Code:
        Public Function SetCustomProperty(ByVal Dwg As Autodesk.AutoCAD.ApplicationServices.Document, ByVal Name As String, ByVal Value As String) As Boolean
            Dim Builder As AcadDb.DatabaseSummaryInfoBuilder
    
            Builder = New AcadDb.DatabaseSummaryInfoBuilder(Dwg.Database.SummaryInfo)
    
            Try
                If Builder.CustomProperties.ContainsKey(Name) Then
                    Builder.CustomProperties.Item(Name) = Value
                Else
                    Builder.CustomProperties.Add(Name, Value)
                End If
    
                Dwg.Database.SummaryInfo = Builder.ToDatabaseSummaryInfo
            Catch
                Return False
            End Try
    
            Return True
        End Function
    Suggestions please!

Similar Threads

  1. Need program for adding custom properties to a line in a drawing
    By chaitanya.1217767394 in forum VBA/COM Interop
    Replies: 2
    Last Post: 2012-02-21, 09:23 PM
  2. Replies: 0
    Last Post: 2011-12-09, 02:57 PM
  3. Replies: 8
    Last Post: 2006-12-12, 12:20 PM
  4. Replies: 12
    Last Post: 2006-09-18, 09:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •