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

RE: [CONNECT .NET Addin] Set color, weight, and linestyle "ByLevel"

$
0
0
I see Bentley.DgnPlatformNET.dll, but no Bentley.MstnPlatformNET

RE: [V8i MDL] How can we obtain a list of Element Templates?

$
0
0

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"

$
0
0
Hi Dave,

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"

$
0
0

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"

$
0
0
Thanks for the help everyone. I did find the active design file but I think the whole thing may have been a false alarm anyway. The Add-ins I've developed primarily have to do with Promis.e which is still built on top of Microstation V8i(select series 4). So I don't think I'm going to have to rewrite everything just yet. It is my understanding that it will eventually run on Microstation Connect Edition, but when I finished installing the latest version on my developement computer today I see that the platform hasn't changed yet. I'm sure however I'll need some help somewhere along the line as I do whenever we update our Promis.e software.

Thanks
Dave

[CONNECT .NET Addin] Set color, weight, and linestyle "ByLevel"

$
0
0

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

$
0
0

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

$
0
0

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?

$
0
0

[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?

$
0
0
mdlElementTemplate_populateNamesListModel creates a list model where each row contains a template name (or optional full path) and ElementID for each element template stored in the current file. If you know ahead of time the template name, path, and file you could then call mdlElementTemplate_getExistingTemplateInFile to load and optionally save the template in the current file.

[V8i MDL] How can we obtain a list of Element Templates?

$
0
0

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

$
0
0

[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

$
0
0

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

$
0
0

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

$
0
0

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

$
0
0

[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

$
0
0

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

$
0
0

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

RE: [Connect COM/ VB, C#] CreateShapeElement1 error

$
0
0

Hi Jan,

Maybe I am doing something wrong, but I have checked function CreateShapeElement1

in Visual Studio Object Browser and parameter <vertices> is System.Array

cheers

Nenad,

RE: [Connect COM/ VB, C#] CreateShapeElement1 error

$
0
0

I don't know where _Application comes from. If I reference bentley.interop.microstationdgn.dll to VB.NET project, I can see this:

Can you share an information what assemblies do you reference in your project?

With regards,

  Jan

Viewing all 7260 articles
Browse latest View live


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