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

RE: [CONNECT - AddIn] Place cell from cellibrary

$
0
0
Hi Maury,
Thanks for sharing, I guess SharedCellElement class might be a bug , I called C++ API to solve this problem

My code is:

UInt64 CreateSharedCellElement(System::String^ cell_name, double oX, double oY, double oZ, double scaleX, double scaleY, double scaleZ)
{
DPoint3d origin = DPoint3d::FromXYZ(oX, oY, oZ);
DPoint3d scale = DPoint3d::FromXYZ(scaleX, scaleY, scaleZ);
MSElement newSCElm;
if (SUCCESS != mdlSharedCell_create(&newSCElm, nullptr, &origin, nullptr, &scale, marshal_as<std::wstring>(cell_name).c_str(), nullptr, 1, 0, nullptr))
return 0;

EditElementHandle eeh(&newSCElm, ISessionMgr::GetActiveDgnModelRefP());
UInt64 elementid = eeh.GetElementId();
if (elementid == 0) {
eeh.AddToModel();
}
return eeh.GetElementId();
}

Viewing all articles
Browse latest Browse all 7260

Trending Articles



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