Jump to content

Purging the whole propertyset definitions using .net api


Recommended Posts

Posted

Hello

 

I am trying imitate the purge action availble in Civil3d 2022 by right clicking on the property set definitions which removes everything.

I need to do this using C#.

 

The code that is short and clear is the next code found somewhere, but complains about the function not finding PropertySetDefinitionCollection

 

using (var db = HostApplicationServices.WorkingDatabase)
            {
                // Get the propertyset definition collection
                var psdColl = db.PropertySetDefinitionCollection; // so it can't find PropertySetDefinitionCollection, it does not exist according to visual studio

                // Purge all the propertyset definitions
                psdColl.Purge();
            }

 

Am I missing something? All dll's should be added: accoremgd.dll, acdbmgd.dll, acmgd.dll, AecBaseMgd.dll, AeccDbMgd.dll.

 

These dll's are in both locations available:

1) C:\Program Files\Autodesk\AutoCAD 2022

2) C:\Program Files\Autodesk\AutoCAD 2022\C3D

 

Does it matter which one you pick?

 

Thank you in advance!

Posted

I don't work in C# but do stuff in CIV3D so maybe  have you declared DB as the correct CIV3D database it varies for each CIV3D version.

 

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...