Jump to content

Update Custom Property Value


Recommended Posts

Posted

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?

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...