RE: [V8i C++] Dumping Tool Data via mdlNamedToolDataNode_getToolData()
The following members of ToolData are returned with a NULL value:pKeyinStr,pTaskId,pMainTaskPathStill hoping to find a way to return the keyin string....
View ArticleRE: [V8i C++] Dumping Tool Data via mdlNamedToolDataNode_getToolData()
Please post a code snippet.
View ArticleRE: Turn off level in View, C++
I see a few items that may or may not be an issue: - You're searching for the LevelID for the given name (In the active model only) and what happens when that level is not found? - In the first code...
View ArticleRE: [V8i C++] Dumping Tool Data via mdlNamedToolDataNode_getToolData()
[quote user="Jon Summers"]Please post a code snippet.[/quote]static int dumpNamedToolDataNode (NamedToolDataNodeP toolDataNode, char* prefix, int dimension, int group) { ToolData *data =...
View ArticleRE: Turn off level in View, C++
[quote user="HDR_Coder"]wstring widestr = wstring(s.begin(), s.end());[/quote]If strings were that simple, they would not have caused so many people so much trouble over the years. std::wstring is a...
View ArticleRE: Turn off level in View, C++
I have a program that lists the names and ids for the levels. If I know the levelID, the first program works. The problem is with my function...
View ArticleRE: Turn off level in View, C++
[quote user="HDR_Coder"] mdlLevel_getIdFromName(&levid,modelRef,LEVEL_NULL_ID,&levelName);[/quote]How is variable levelName declared? The function is expecting a const pointer to a wide...
View ArticleRE: Turn off level in View, C++
Excellent solution Jon!The code is now up and working. Here is the source code:wchar_t* convertStringto_wchar_t(string s) { const char * c = s.c_str(); const size_t cSize = strlen(c) + 1; wchar_t* wc...
View ArticleRE: Turn off level in View, C++
Memory Leak![quote user="HDR_Coder"]MSWCharP levelName; levelName = convertStringto_wchar_t(line); DgnModelRefP modelRef = mdlModelRef_getActive();[/quote]Your conversion function allocates memory, but...
View ArticleRE: [V8i C++] Dumping Tool Data via mdlNamedToolDataNode_getToolData()
Can you confirm the NamedToolData from a/your custom tool (path) that saved in a dgnlib? If so, pKeyinStr should have a value. Bob
View ArticleRE: [V8i C++] Dumping Tool Data via mdlNamedToolDataNode_getToolData()
I went and ran the code (essentially the code example snippet in the .fdf file) in DEBUG mode. Once mdlNamedToolDataNode_getToolData() sets the pointer to ToolData, I "break" on the next statement so I...
View Article[V8i C++] Dumping Tool Data via mdlNamedToolDataNode_getToolData()
I'm traversing the ListModel of tasks from mdlNamedTool_populateTaskListModel(). After I load the tool (mdlNamedToolDataNode_loadByPath(), I call mdlNamedToolDataNode_getToolData(). I'm attempting to...
View ArticleRE: Turn off level in View, C++
Very good solution. Here is Jon's suggestion in the source code:std::wstring convertStringto_wchar_t(string s) { const size_t cSize = s.length() + 1; wchar_t* wc = new wchar_t[cSize]; mbstowcs(wc,...
View ArticleRE: Turn off level in View, C++
[quote user="HDR_Coder"]Why couldn't I dereference my pointer later in the code?[/quote]I assume that you mean deallocate?Because, as you've demonstrated, it's easy to forget to delete something that...
View ArticleRE: Turn off level in View, C++
I just meant that mdlLevel_getIdFromName, for the fourth argument takes an MSWCharCP, but mdlLevel_getIdFromName(&levid, modelRef, LEVEL_NULL_ID, levelName.c_str()); gives it a const char *. I...
View ArticleRE: Turn off level in View, C++
No, it doesn't give it a const char *. It gives a const wchar_t *. And char != wchar_t (unicode vs. multibyte)
View ArticleRE: Turn off level in View, C++
std::basic_string is a template class. Method std::basic_string::c_str () returns a const pointer to the start of the contained character string.std::string is a typedef of std::basic_string that...
View ArticleRE: Turn off level in View, C++
I have modified the program to hide levels for the active model reference or any attached model reference. Right now you can only do one .dgn at a time. Here is the source code:std::wstring...
View ArticleTurn off level in View, C++
I have a snippet of code that is supposed to read a textfile with level names and turn those levels off.Here is my first attempt:wchar_t convertStringto_wchar_t(string s) { wstring widestr =...
View ArticleRE: How do I hide a ListBox row?
Identify Your PlatformPlease identify the version of MicroStation, or other product such as PowerDraft, that you are using: MicroStation CONNECT or MicroStation V8i.The APIs supplied with MicroStation...
View Article