How to place shared cell in a library?

Hello,

I have the following situation:

I have received DWG file and it has various shared cells in the model. I obviously don't have corresponding .cel file with the definitions and I know I can export them all to separate file but it creates hundreds of models which have nested models (definitions) inside with even more nested definitions and it's too messy to work with. What I would like to do is to attach a blank library and save definitions I need to edit in that library one by one so I can edit shared cell and update in the model and move to the next one. Is that possible somehow without taking this shared cell, resetting rotation/scale setting up the origin, dropping the instance, creating a new definition for editing and cleaning up the file? It seems very complicated since that definition is already in the file... I am happy if it could be done programmatically even! Ideally, I would love to be able to edit it in place but that doesn't seem to be possible?

Also related to this, what would happen if I do the following:

I have shared cell (A) inside multiple other shared cells (B, C, D and so on) in my file and it is also all saved in the library. Then I open the library and edit shared cell (A) and save the library. Now I understand that all the shared cells in the library (B, C, D and so on) contain updated definition as the library has basically nested structure with nested models, right? So if I now open my main file and reload the library and decide to update those cells (B, C, D and so on) from the library, am I safe to assume that all the instances will contain an updated version of the cell (A)??

Regards,

Bartosz Perepeczo

Parents
  • What I would like to do is to attach a blank library and save definitions. I am happy if it could be done programmatically

    I think a programmatic solution is your sole recourse.  What you're asking is to create a new DGN cell library that will contain nested cell definitions, using existing DGN shared cell definitions as the source data.  It's an unusual request because of your workflow: the original DWG cells are not available to you.  If they were available, your life would be a lot simpler.

     
    Regards, Jon Summers
    LA Solutions

  • Jon,

    I tried using Application.AttachedCellLibrary.AddCell method and it kind of works (not preserving rotation and scale for starters!) but in order to pass my shared Cell definition I need to pass it as a regular Cell and I use .GetAsNormalCell method. For some reason nested Shared Cells become regular Cells... I wonder maybe it's because there are no nested shared cell definitions in the library yet? I probably would need to create them recursively from most nested first, if that's the reason for the structure being changed... Hopefully, it's not the method changing their structure.

    Technically they are available - they are in my file! That's why it's most annoying as they're there but I can't edit them. And I can't save them in editable form as there is no tool I would know of to do so :(.

    Regards,

    Bartosz Perepeczo

  • I probably would need to create them recursively from most nested first

    Yes.

    .GetAsNormalCell

    Post questions about VBA to the Programming Forum.

     
    Regards, Jon Summers
    LA Solutions

Reply Children
No Data