Jump to content

Update Custom Property Value

Recommended Posts


I have searched quite a bit for this with no avail. I am trying to update the value of pre-existing custom properties in a drawing using .net. I can get the current value with ease, but updating it has become difficult.


Any help?

Share this post

Link to post
Share on other sites

Never mind I figured it out

    Sub PutAcadCustomeProps(ByVal custPropName As String, ByVal custPropVal As String)

       Dim DB As Database = Application.DocumentManager.MdiActiveDocument.Database
       Dim objSumBuilder As DatabaseSummaryInfoBuilder = New DatabaseSummaryInfoBuilder(DB.SummaryInfo)
       Dim custProps As IDictionary = objSumBuilder.CustomPropertyTable

       If custProps.Contains(custPropName) Then
           objSumBuilder.CustomPropertyTable.Item(custPropName) = custPropVal
           DB.SummaryInfo = objSumBuilder.ToDatabaseSummaryInfo()
       End If

   End Sub

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now