Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

RE: [CONNECT - AddIn] Place cell from cellibrary

$
0
0

Thank you very much for your reply Jon.

I've added the following lines to my code:

bool sharedCellDefPresent = false;
            SharedCellDefinitionCollection cellDefColl = Session.Instance.GetActiveDgnFile().GetNamedSharedCellDefinitions();
            foreach (SharedCellDefinitionElement cellDefElmTemp in cellDefColl)
            {
                if (cellDefElmTemp.CellName == "BRND")
                    sharedCellDefPresent = true;
            }

            if (!sharedCellDefPresent)
            {
                SharedCellDefinitionElement cellDefElm = new SharedCellDefinitionElement(Session.Instance.GetActiveDgnModel(), "BRND");
                cellDefElm.AddToModel();
            }

Unfortunately the result is still the same. I've tried to create a new designfile just to check if something has happened with the original test file but no.

I've stepped through the NamedSharedCellCollection again and now the SharedCellDefinion is present...

Regards Evan


Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>