Has any body, had any success in comping any of the CONNECT SDK examples (BasicDialogBox) inside a Windows 10 environment?
Or is it just me. Within Windows 7, works just fine.
re: CONNECT SDK & Windows 10
RE: [CONNECT C++] empty TextBlock
[quote user="Jon Summers"]Perhaps your TextBlock is empty?[/quote]
It's probably easier to ask again and again instead of coding a bit more and to e.g. add ASSERT or to use existing TextBlock API functionality to ensure what is happening and why such status is returned. Just checking API documentation, there are methods like IsEmpty() to evaluate if MicroStation thinks the textblock is empty, ToString() to check what is inside text block instance and at first to check what is inserted into text block ... I assume AppendText is used, but what is the used parameter (should be WCharCP)?,
Regards,
Jan
[CONNECT C++] empty TextBlock
Hi,
I tried to create a text element. I got a return value which says"it did not have the force text node flag".
Which command can be used to set "text node flag"?
Thanks
TextBlockToElementResult EleTxtReturn = TextHandlerBase::CreateElement(eeh, NULL, *textBlock)
EleTxtReturn = TEXTBLOCK_TO_ELEMENT_RESULT_Empty
C# example delivered with the latest MSTN Connect SDK
I built 2 c# samples delivered with the latest MSTN Connect SDK: WPFSample & Bentley.DgnIModelNETExample, I got the dlls also the addin loader ma files (under C:\Users\{username}\AppData\Local\Temp\Bentley\MicroStation\10.0.0\AddInLoader1.0)
but I can't load the .ma file in mstn v10.02.00.39, do I still need to load .ma to subsequently load the addin? if not, how do I load the addin
Thanks
RE: C# example delivered with the latest MSTN Connect SDK
What happens when you key-in mdl load WPFSample.dll? What messages do you see?
[quote user="m gao"]I got the addin loader ma files (under C:\Users\{username}\AppData\Local\Temp\Bentley\MicroStation\10.0.0\AddInLoader1.0)[/quote]
The result of a .NET build is a DLL. The .ma is a temporary file created by MicroStation, not part of your build process.
WPFSample
I built the WPFSample using Viz Studio. I had one problem: Viz Studio complained that the sample .NET framework version 4.0 was earlier than the MicroStation CONNECT U2 DLL framework version 4.5. I modified the project settings for WPFSample in Viz Studio and it built OK in both debug and release.
I confirmed that Viz Studio had placed WPFSample.dll in the mdlapps folder. After I key-in mdl load WPFSample, I have to key-in wpfsample open and wpfsample opendock to see these dialogs...
RE: C# example delivered with the latest MSTN Connect SDK
Hi m gao,
[quote user="m gao"] built 2 c# samples delivered with the latest MSTN Connect SDK[/quote]
How did you build the samples? It seems there are three options available:
- using bmake
- from Visual Studio environment
- using bat file (which should be equal to Visual Studio option, because devenv is called)
[quote user="m gao"]I got the dlls also the addin loader ma files (under C:\Users\{username}\AppData\Local\Temp\Bentley\MicroStation\10.0.0\AddInLoader1.0)[/quote]
To be precise, you did not. As Jon mentioned, .ma is temporary file and in the case of managed addins it's not produced during the building process, but it's created by MicroStation itself automatically when the addin is requested to be load for the first time.
[quote user="m gao"]but I can't load the .ma file in mstn v10.02.00.39[/quote]
How did you load the sample? E.g. if there is WPFSample example, WPFSSample.dll is created in MicroStation\Mdlapp folder. So the application should be loaded by mdl load wpfsample key-in, so in fact you ask to load dll, but MicroStation creates ma automatically ... and you don't use mdl load wpfsample.ma key-in.
[quote user="m gao"]do I still need to load .ma to subsequently load the addin?[/quote]
It's the same as it was in V8i: MicroStation need ma loader to work with addins, but it's internal MicroStation process, you work and load with dll assemblies only.
With regards,
Jan
RE: C# example delivered with the latest MSTN Connect SDK
one thing special in my environment is that I only have VS2013 express, as a result, I have to modify the delivered .mke as follows as
a. there is NO 'devenv.exe' in VS2013 express, have to use 'wdexpress' instead
b. wdexpress does NOT support 'rebuild' option, have to use 'ResetSettings' option instead
FROM:
%if defined(BMAKE_DELETE_ALL_TARGETS)
Clean:
devenv "$(SlnFile)" \/clean $(buildConfiguration)
%else
%if defined (BMAKE_BUILD_ALL)
BuildOp = \/rebuild
%else
BuildOp = \/build
%endif
BuildOrRebuild:
devenv "$(SlnFile)" $(BuildOp) $(buildConfiguration) # $(UseEnvOpt)
%endif
To:
%if defined(BMAKE_DELETE_ALL_TARGETS)
Clean:
wdexpress "$(SlnFile)" \/clean $(buildConfiguration)
%else
%if defined (BMAKE_BUILD_ALL)
BuildOp = \/ResetSettings
%else
BuildOp = \/ResetSettings
%endif
BuildOrRebuild:
wdexpress "$(SlnFile)" $(BuildOp)
%endif
RE: C# example delivered with the latest MSTN Connect SDK
[quote user="m gao"]I only have VS2013 express[/quote]
Why you don't use Visual Studio 2013 Community Edition? It does not relate too much to the discussed problem, but Community Edition provides nearly the same functionality as full Visual Studio, does not have VS Express limitations, and is, under some conditions, free for use.
Regarding to the discussed problem: I recommend to open the solution project in Visual Studio and to compile it in VS, not using bmake. I roughly remember there were some problems with WPF demo solution and I have to modify the project (change assemblies, target platform...), but it was quick and the compilation works fine. Using VS compilation you can check if the problem is in your bmake (if output from VS will work) or somewhere in your installation (if VS output will not work also).
With regards,
Jan
RE: C# example delivered with the latest MSTN Connect SDK
[quote user="m gao"]wdexpress does NOT support 'rebuild' option[/quote]
Viz Studio has an internal make file. The build process checks dependencies to find what must be rebuilt. If a dependency is out-of-date or missing, then it is rebuilt. A simple way to force a rebuild is to delete all dependencies.
As far as I can see, for the WPFSample example, there is only one dependency: WPFSample.dll. If you delete that file, then Viz Studio will rebuild it.
Please refer to my earlier post: I am able to build and run that example.
RE: Drop Element
Further to others' suggestions, you can also preset the "Drop Element" tool using key-in: "set item toolsettings <option> = <1|0>"
The only thing with using the "set item toolsettings" key in is that you can only use it after a tool has been run. So the sequence of key-in would be:
drop element
set item toolsettings <option1> = <1|0>
set item toolsettings <option2> = <1|0>
...
or to combine them into a singleline:
drop element;set item toolsettings <option1> = <1|0>;set item toolsettings <option2> = <1|0>;...
If you want more information on how to utilise the key in, you can refer to these 2 AskInga posts:
Note that there's a limit on the number of characters in a combined key-in, so you may not be able to preset all the tool options using just 1 keyin. If you find yourself there, VBA would be the best way to go.
RE: Automation Error with TAG.Value when reading from Excel
[CONNECT C++] Element Handlers
Hi all,
First of all, let me apologize in advance if this comes across as a little incoherent. I'll do my best to state what I am trying to achieve.
I am trying to develop an application that can place a series of cell elements linearly. Which is easy enough, and I can accomplish this no problem.
I would then like to be able to use the standard MicroStation selection tool to select one or all of my series of cell elements and for MicroStation to display my own custom manipulators on top of these elements (I believe this can be done using view decorations and transient elements, etc.).
What I don't quite get is what is the best way to recognize these elements as a special type of element that should display my manipulators while my application is running.
Do I need to monitor element selection events and check each cell element for some piece of data that tells me that it belongs to my application, and then create the manipulators on screen.
Or, preferably, can I use the element handler classes to create my own special type of element (which inherits from cell elements) that I can provide callbacks to my own functions to handle displaying manipulators, etc.
Any pointers as to where I can find more information would be great.
Thanks
Liam
[C# Connect] Creating Meshes
In the past I have posted about trying to utilize PolyfaceHeader::CreateXYTriangulation in C#, however it is only available in native code.
Today, I was looking through the assemblies packaged with MicroStation Connect and noticed TerrainModelNET.
I have referenced in this dll and I am able to add points and triangulate a DTM (among other useful things), however, I do not see any way of converting this into a mesh element.
Does anyone have any insight into how to use the TerrainModelNET API?
RE: [V8i MicroStationAPI] ElementFacetSet
A couple comments that may be of some help.
WRT #1. The MDL example "imodelvisitor" has a method that may be of help called: Reporter::ReportFacetSet. A few key lines are:
imodelvisitor\Reporter.cpp:843: int pCount = pFacets->GetPointCount(); imodelvisitor\Reporter.cpp:844: int fCount = pFacets->GetPointIndexCount(); imodelvisitor\Reporter.cpp:852: ReportDpoint3d (L"Facet_Point",*pFacets->GetPoint(i),loopNodeP,Adjustment_None); imodelvisitor\Reporter.cpp:855: const Int32 * pFacetIndex = pFacets->GetPointIndices();
WRT #4
When implementing an IElementGraphicsProcessor consider the two output options for _ProduceGPAs and _ProduceFacets, taking careful note of the "param comments" of each:
struct IElementGraphicsProcessor { //! Allow open curves, closed curves, and regions to be output as a GPArray. Necessary for collecting //! higher level graphics such as complex strings, complex shapes, and regions. //! @param[in] isCurved Graphics output would contain non-linear geometry. //! @note When returning true you also need to implement _ProcessGPA. virtual bool _ProduceGPAs (bool isCurved) const {return true;} //! Allow surface and solid geometry to be output as a facet set. //! @param[in] isIndexedPoly Output will be from a call to AddIndexPolys, ex. mesh element. //! @return true to output facets for surface and solid geometry. //! @note When returning true you also need to implement _ProcessFacets. virtual bool _ProduceFacets (bool isIndexedPoly) const {return isIndexedPoly;}
FYI. Imodelvisitor sample also has some code for working with GPAs here: imodelvisitor\Reporter.cpp:872:void Reporter::ReportGPArray
HTH,
Bob
RE: Drop Element
[quote user="Lorys"]For interests sake , what is the limit on characters in a key combination?[/quote]
The answer is 42 :)
RE: Drop Element
RE: [V8i MicroStationAPI] ElementFacetSet
[quote user="Robert Hook"]The MDL example "imodelvisitor" has a method that may be of help called: Reporter::ReportFacetSet[/quote]
Yes, I'm aware of the iModelVisitor example. The documentation omits to mention what type of facets ReportFacetSet creates: triangular, quadrilateral or something else?
It also omits to mention how the points are organised, and how the indexing works. Without knowing those three bits of information, the facetting is an unordered stream of DPoint3d data.
RE: Automation Error with TAG.Value when reading from Excel
I've encountered this issue previously though the error code was slightly different by 1 digit but the problem was similar i.e. unable to retrieve the tag value and the Automation error within the watch window. Your snapshot of the IDE doesn't reveal all your code but my guess is that your are using OpenDesignFileForProgram. Something changed within the last 6 years in either the office suite VBA or within MS where OpenDesignFileForProgram no longer works with Tag Elements and you are forced to use variants with that method instead.
Change OpenDesignFileForProgram to OpenDesignFile instead, no need to declare your tagelements as variants and your problem should be fixed.
HTH
Barry
RE: [V8i MicroStationAPI] ElementFacetSet
[quote user="Jon Summers"]
The ElementFacetSet class provides plenty of information about the facets it holds. Unfortunately the methods that reveal the information are sparsely documented in MicroStationAPI help.
For example...
- How are points (obtained using GetPoint()) and point indices (obtained using GetPointIndices()) related?
- Are facets always (a) triangular, (b) rectangular or a mixture of those?
- What does GetNumPerFace() tell us?
- Are ElementFacetSet and PolyFaceArrays related?
[/quote]
1. See 3.
2. That depends on ElementFacetOptions::GetMaxPerFace, which by default won't triangulate.
3. If > 1, each face is present in the index array as that number of indices, padded by 0 as needed, otherwise, the faces are variable size with 0 terminator.
4. No, but they are comparable...see below:
PolyfaceArrays arrays;
memset (&arrays, 0, sizeof (arrays));
arrays.pIndex = facets->GetIndexArray(); <- facets is ElementFacetSet*
arrays.pXYZ = facets->GetPointArray();
arrays.pUVIndex = facets->GetParamIndexArray();
arrays.pNormalIndex = facets->GetNormalIndexArray();
etc...
HTH
-B
RE: [V8i MicroStationAPI] ElementFacetSet
[quote user="Brien Bastings"]ElementFacetOptions::GetMaxPerFace, which by default won't triangulate[/quote]
So if my class implements
virtual int GetMaxPerFace () { return 3; }
then I'll get triangles?