RE: [CONNECT .NET Addin] Set color, weight, and linestyle "ByLevel"
RE: [V8i MDL] How can we obtain a list of Element Templates?
MicroStation V8i SDK provides a customize element template example located here:
FILE: C:\Users\<username>\Documents\MDLProjects V8i (SELECTseries 4)\CustomizeTestApp\CustomizeTestApp.cpp +1227
FUNC: dumpActiveFileTemplateList
mdlElementTemplate_populateNamesListModel only searches only within the active design file. I will check with the developer after the holiday break to see if any variants of this function for specific design file or within dgnlib path are safe to use/release for public consumption.
MicroStation CONNECT SDK include ..\include\Mstn\XDataTree\MstnElementTemplate.h and call PopulateNamesListModel(,,,DgnFileP searchSpecificFile,)
HTH,
Bob
RE: [CONNECT .NET Addin] Set color, weight, and linestyle "ByLevel"
why do you assumue Bentley.MstnPlatformNET should exist as dll file?
Using standard NET tools (like Visual Studio or JustDecompile) I found Bentley.MstnPlatformNET namespace spread over several different assemblies. If talking about active design file, Bentley.MstnPlatformNET.Session class is located in ustation.dll assembly.
With regards,
Jan
RE: [CONNECT .NET Addin] Set color, weight, and linestyle "ByLevel"
Bentley.MstnPlatformNET is a namespace reference specific to the MicroStation (Mstn) executable who's primary dependent dynamic library to ustation.dll. MicroStation add-ins projects simply reference ustation.dll to obtain a number of MicroStation product-specific common namespace and runtime library code and functionality required. You can verify where a namespace maps using the Microsoft Object Browser (Ctrl+Alt+J), search for a namespace name or item noting the "Member of" that you can click through to identify the underlying full path and file name of the related library reference.
HTH,
Bob
RE: [CONNECT .NET Addin] Set color, weight, and linestyle "ByLevel"
Thanks
Dave
[CONNECT .NET Addin] Set color, weight, and linestyle "ByLevel"
In V8i addins I could easily set the color, weight, and linestyle to bylevel using:
Element.Color = -1
Element.Weight = -1
Element.LineStyle = ByLevelLineStyle
How do you achieve the same results in CONNECT? I know you use the ElementPropertiesSetter but can't figure out the "bylevel" value to use:
ElementPropertiesSetter.SetColor(??)
ElementPropertiesSetter.SetWeight(??)
ElementPropertiesSetter.SetLinestyle(??,??)
[Connect API] Missing headers/declarations in SDK
Hi,
I am using MicroStation Connect SDK 10000028.
I have noticed than some headers/declarations are missing
-------------------------------------------------------------
IPointCloudChannelVectorCR
PointCloudChannelId
--------------------------------------------------------------
When trying to compile header containing these two lines :
#include <DgnPlatform\DgnPlatformAPI.h> #include <PointCloud/PointCloudApi.h>
I am getting these errors:
error C2061: syntax error : identifier 'IPointCloudChannelVectorCR'
error C2061: syntax error : identifier 'PointCloudChannelId'
thanks
Nenad
[Connect API] Attach reference reprojected
In V8i you could something like this to attach a reference reprojected:
mdlRefFile_setParameters ((void *) ATTACHMETHOD_GeographicProjected, REFERENCE_ATTACHMETHOD, ModelRef);
I want to do the same in Connect:
mdlRefFile_setIntegerParameters(ATTACHMETHOD_GeographicProjected, REFERENCE_ATTACHMETHOD, ModelRef);
The problem is that the enum value "ATTACHMETHOD_GeographicProjected" can't be found in the headerfiles.
I've made a small workaround:
#ifndef ATTACHMETHOD_GeographicProjected #define ATTACHMETHOD_GeographicProjected 31 #endif
This will work but I think that the headerfiles should be updated to include the enum values.
Regards, Evan
RE: [V8i MDL] How can we obtain a list of Element Templates?
[quote user="Robert Hook"]dumpActiveFileTemplateList()[/quote]
Thanks for the reference to that MDL example. As well as the element template name and path, it retrieves an Element ID from the ListModel. That's what, exactly — the ID of the template in the active design file, the ID of the template in its DGNLib or something else?
I don't see any mdlElementTemplate_function that accepts an ID as input. Can we do anything with that ID?
RE: [V8i MDL] How can we obtain a list of Element Templates?
[V8i MDL] How can we obtain a list of Element Templates?
mdlElementTemplate_populateNamesListModel() presumably obtains its data from the active DGN model. But, does it search all attached DGNLibs for that information?
That's the only function I can see that gathers a collection of templates. Is there any other?
RE: [Connect COM/ VB, C#] CreateShapeElement1 error
[quote user="Nenad Poljcic"]I have a code that works in V8i but produces error in Connect[/quote]
Use the DgnPlatformNET API. Take a look at the ShapeElement class in the help document for that API.
RE: [Connect COM/ VB, C#] CreateShapeElement1 error
Hi Jon,
I can not use MicroStation API because my application is external application ( not part of MicroStation) and
I want to send data to MS using COM ( there is other way)
thanks
Nenad
RE: [Connect COM/ VB, C#] CreateShapeElement1 error
Hi Nenad,
why do you cast Point3d[] array to System.Array? I don't see any reason to do it and even the parameter itself is defined (using decompiler) as [In][Out] ref Point3d[] Vertices. Make your code simpler and use Point3d[] as required, I guess it should work fine.
I also don't understand why you pass vArray as ref, because any array is reference type and is always passed as reference and not value, so ref modifier is reduntant.
With regards,
Jan
RE: [Connect COM/ VB, C#] CreateShapeElement1 error
Hi Jan,
I cat Point3d array to System.Array because it was only way it worked in V8i.
However , I tried your suggestion and I get same error.
MicroStationDGN.Application myMSapp = new MicroStationDGN.Application(); MicroStationDGN.Point3d[] vertices = new MicroStationDGN.Point3d[4]; vertices[0] = myMSapp.Point3dZero(); vertices[1] = myMSapp.Point3dFromXYZ(1000, 0, 0); vertices[2] = myMSapp.Point3dFromXYZ(1000, 1000, 0); vertices[3] = myMSapp.Point3dZero(); MicroStationDGN.ShapeElement shape; shape = myMSapp.CreateShapeElement1(null, vertices , MicroStationDGN.MsdFillMode.msdFillModeNotFilled);
thanks
Nenad
RE: [Connect COM/ VB, C#] CreateShapeElement1 error
[quote user="Nenad Poljcic"]I can not use MicroStation API because my application is external application ( not part of MicroStation) and
[/quote]
When you post a question, please supply all relevant information about the operating environment.
[quote user="Nenad Poljcic"]I want to send data to MS using COM[/quote]
Is the external application a 64-bit app.?
RE: [Connect COM/ VB, C#] CreateShapeElement1 error
Hi Jon,
I am using windows 7, Visual Studio 2013
My external application is 64bit. I added reference Bentley.MicroStation 10xObject Library 9.1
I am using other COM functions and structures and all work fine except CreateShapeElement1
Nenad
RE: [Connect COM/ VB, C#] CreateShapeElement1 error
Hi Nenad,
[quote user="Nenad Poljcic"]I cat Point3d array to System.Array because it was only way it worked in V8i.[/quote]
Hmm ... I don't believe it, but right now I have no time to test it. There is not any reason for casting and Point3d[] works fine in add-in (where should be no difference in this case). I will try to test it in V8i (an maybe also in CONNECT EDITION) using Automation object later.
With regards,
Jan