I'm using a method I referenced in
to "add" an Item to a Element Template so that when the template is activated and an element is placed, the element gets the Item data as well as the other template parameters. As Paul mentioned:
Paul Connelly said:
"That will sort-of work, except there is a specific flag that must be set on the ECInstance indicating it is an Item attached to a Template, which enables template-specific behavior.
Without that flag, you may find some things don't work as you expect."
Well.. I *think* I may have just run into that situation. When I activate my template, when I place a line, I get the template parameters, but NOT the Item applied to the element. If I activate the Element Template Association lock, when I place a line, MicroStation "hangs" for a few seconds, then aborts. The error log shows the last thing performed:
Bentley::ECN::ECSchema::ReComputeCheckSum
So, I'm wondering if this crash is related to what is noted by Paul. The initial post was a few "updates" back, so is that comment still appropriate?
Bruce
Exception String: 'Access Violation'
Memory Statistics for process ID 22344:
24473 MB Total Phys
14146 MB Avail Phys
49049 MB Total Page File
39633 MB Avail Page File
134217727 MB Total Virtual
134216000 MB Avail Virtual
0 MB Avail Extended Virtual
504 MB PeakWorkingSetSize
504 MB WorkingSetSize
591 MB PagefileUsage
763 MB PeakPagefileUsage
373326 PageFaultCount
1575168 QuotaPeakPagedPoolUsage
1550128 QuotaPagedPoolUsage
209864 QuotaPeakNonPagedPoolUsage
192320 QuotaNonPagedPoolUsage
621 GDI Objects
184 USER Objects
Wrote a mini-dump type 0x4 to "c:\Temp\Bentley\MicroStation\10.0.0\MiniDump.dmp".
Stack dump:
Exception: 0xc0000005 @ 0x3f76f5d9
0: 00000016a2ffd090 00007ffa2ce8a7e2 fffffffffffffffe ffffffffffffffff 0000013fe1b4d298 00007ffa2c9bd4c9 Bentley::ECN::ECSchema::ReComputeCheckSum+0x19
1: 00000016a2ffd110 00007ffa2d336b79 0000000000000000 0000000000000000 00000016a2ffd1c9 0000013feb74f548 Bentley::DgnPlatform::DgnECManager::ImportSchema+0x62
2: 00000016a2ffd220 00007ffa2d30da17 0000013f00000000 0000001600000001 0000013fe8da1e28 0000013f8fb4d778 Bentley::DgnPlatform::XDataTreeOwner::GetStandaloneECEnabler+0x359
3: 00000016a2ffd2f0 00007ffa2d30d813 00000016a2ffd3e8 0000013fe2091fb8 000000000000048c 00007ffa2d30dc00 Bentley::DgnPlatform::ElementTemplateNode::CreateNode+0x1e7
4: 00000016a2ffd350 00007ffa2d30e221 0000013f8fb4d6a0 0000013fe2091fb8 00000000583b0001 0000013fe2091fb8 Bentley::DgnPlatform::ElementTemplateNode::CreateNode+0x63
5: 00000016a2ffd3c0 00007ffa2d3259bc 00000016a2ffd4e8 0000000000000001 0000013fe98e8ae0 00007ffa00000014 Bentley::DgnPlatform::ElementTemplateNodeHandler::GetHandlerId+0x231
6: 00000016a2ffd420 00007ffa2d3358b9 00007ffa2d49a700 0000013feb1ee160 0000000000000001 0000013f8fb4d6a0 Bentley::DgnPlatform::IXDataNodeHandler::CreateNode+0x4c
7: 00000016a2ffd570 00000000704604a5 0000013feb74f548 0000013feb74f548 0000013feb1ee160 00000000583b0001 Bentley::DgnPlatform::XDataTreeOwner::CopyNodeFromFile+0x559
8: 00000016a2ffd5f0 00000000704608be 0000013feb1ee160 00000016a2ffd660 00000016a2ffd728 00000016a2ffd728 Bentley::MstnPlatform::MstnElementTemplateMgr::CopyTemplateToFile+0x95
9: 00000016a2ffd680 000000007045f119 0000013fe97f3b90 0000013feb1ee160 00000016a2ffe401 0000013feb824ac0 Bentley::MstnPlatform::MstnElementTemplateMgr::CreateFromExisting+0x23e
10: 00000016a2ffd710 00007ffa2f36ebee 0000013fe97f3b00 0000000000000000 0000013fe97f3b90 00000016a2ffd799 Bentley::MstnPlatform::MstnElementTemplateMgr::AddActiveTemplateReference+0x79
11: 00000016a2ffd7f0 00007ffa2f370372 0000013fe97f3b90 00000016a2ffd8c8 3f765e72c3b3902d 0000000000000000 Bentley::UIFramework::BSize::operator=+0x88642
12: 00000016a2ffd850 00007ffa2f372a1b 000000007107c4b0 00000016a2ffdb20 00000016a2ffe460 40bd3366d42b8c78 Bentley::UIFramework::BSize::operator=+0x89dc6
13: 00000016a2ffd890 000000007084d53a 000000007107c4b0 00000016a2ffe460 0000000000000000 000000007086f96a Bentley::UIFramework::BSize::operator=+0x8c46f
14: 00000016a2ffd8e0 00000000703ea0af 0000013fe1e376c0 00000016a2ffe460 0000000000000000 407e000000000000 SystemCallback::SetWorkspaceChangedFunction+0xc0a
15: 00000016a2ffd910 00000000703eab7d 000000007107c4b0 00000016a2ffdb20 00000016a2ffe460 00000016a2ffdb20 Bentley::DgnPlatform::DgnTool::SetCmdNameAndPromptByString+0x19ff
16: 00000016a2ffd9b0 00000000709515d8 000000007107c4b0 0000000000000002 00000016a2ffe401 00000000e41f82d8 mdlState_startInputGenerator+0x22d
17: 00000016a2ffd9e0 00000000709513f7 00000000e41f82d8 00000016a2ffda01 00000016a2ffe460 01d3d189fafe3d0d mdlSystem_parseFileNameAndModelName+0x1888
18: 00000016a2ffda10 000000007094bd37 0000000000000000 3b00000000000000 0000000000000000 00007ffa6a10be53 mdlSystem_parseFileNameAndModelName+0x16a7
19: 00000016a2ffe400 000000007094fad5 00000016a2ffe460 0000000000000001 0000013fc4169418 00007ffa644240e0 priorityGui_initialize+0xe17
20: 00000016a2ffe430 00000000707ebd34 00000000707ed110 00000000707ed110 0000000000000000 0000000000000000 mdlInput_processQueuedInput+0x25
21: 00000016a2ffe470 000000007088e09e 365e7659e72b0000 0000000000000009 fffffffffef29e19 000000006fa2a5f4 mdlInput_handleModifierTransition+0x124
22: 00000016a2ffe4b0 000000007088fea3 000000007107c4b0 0000013fe11f1d50 0000000000000003 0000013fc4162530 Bentley::MstnPlatform::ISessionMgr::SetSnapsPopupGroupKeyin+0xcee
23: 00000016a2ffe500 00000000709111e3 0000013fc4162530 0000013fc1d43f4c 0000000000000000 0000000000000000 mdlSystem_recordUserActivity+0x223
24: 00000016a2ffe740 00007ff6d8db5570 ffffffff8b011764 00007ff6d8db0000 0000013fc1d43f4c 0000000000000001 win32Intface_winMain+0xb3