Browse By Tags

  • [CONNECT U16 C#] How to copy element from one model into a new DGN? (Add-in crashes on dgnFile.ProcessChanges)

    Hi, as a follow-up to this thread , I'm trying to copy an element from an currently opened DGN file to a new temporary DGN file in order to export the single element (normally a cell) as an FBX file. According to suggestions that I've read in this forum…
  • get referenced files using .net

    hi, i'm wondering if it is possible to get a list of the referenced files in a .dgn using the sdk? similar to the result from `microstation.exe -waref [path]` thanks versions: MicroStation Connect Edition Update 16 and MicroStation Connect Edition SD…
  • CONNECT C# U16.2 What is the difference in behaviour between Element.GetNativeElementRef() and Element.GetNativeElementRefFromDescr() and when should each be used?

    Hallo, In this post, Jon Summers commented the following: "I notice that there is a similar function public IntPtr GetNativeElementRefFromDescr() . How that differs from GetNativeElementRef() is not clear." Have you since found the difference between…
  • Dgn to Pdf using Microstation SDK in a C# .Net Project

    I am creating a C# .Net app where I want users to be able to convert a .dgn file to .pdf. Could anyone point me towards some documentation, tutorials or code examples that could show me how to achieve this? Which .dll's are required as references? What…
  • How to create EC Scheme for microstation connect?

    Hi Can anyone please show/explain me the way I can create EC Schema for microstation connect using C#? Regards
  • [C# CE] XCommand example solution?

    Does anyone have XCommands built and working in .NET and have some example code they might be able to share? I was looking to test this out, but in the docs it involves messing around with a bmake file and a bunch of xml, which I'm not really sure how…
  • [CE U16 C#] IECPropertyValue - obtain correct units?

    Hi all, I'm building an addin that obtains all of the IDgnECInstance data attached to elements in a collection and exports this; however some of the data gathered is at system resolution whilst other properties is model resolution (x U.O.R). Is there…
  • DgnECManager.Manager.OnInstanceUpdated

    I am trying to use OnInstanceUpdated but it doesn't even hit my breakpoint? (It does update the Schema, and returns Success, but it just seems to remove the element instances.) private DGN.SchemaUpdateStatus UpdateSchema() { try { FindInstancesScope…
  • [CONNECT Update 16 C#] Add new model programmaticaly starts with four views (but I need only one).

    Hi I'm trying to add new models to an existing dgn file. The new model must have only one view, but actually is created with 4 views. The active Model actually has one only one view (but this not propagated to new models). Here a snippets of my…
  • [MSCE 10.16 C#] Place text interactively with desired angle

    Hi, Using examples from the forum, I can place a text interactively. Unfortunately, the text is not yet set to the desired 45°, but to 58.3101°. using System; using System.Collections.Generic; using System.Diagnostics; using BM = Bentley.MstnPlatformNET;…
  • [CE U16.2 C#] Bridge between Bentley.Geometry.SolidPrimitive and Bentley.DgnPlatformNET.SolidKernelEntity to use Bentley.DgnPlatformNET.Modify Boolean operations?

    I have a DgnPrimitiveTool derivative that generates solids into a DGN from data in a database as an interpretation of the data. This tool can generate individual Solid elements using the SolidPrimitive.CreateDgnBox(DgnBoxDetail) function with no problem…
  • [MicroStation CONNECT update 16 C#] Export or save as an CIT raster to JPEG from inside an InitApp

    Looking for some help in being able to open and either saveas or export a cit file into a jpeg. Please see the below examples of what I have tried: [Bentley.MstnPlatformNET.AddIn(ApplicationType = MdlApplicationType.InitApp, MdlTaskID = "MicroStationAddinExample…
  • [C# MS V10.16.02.34] IPrintset.Publish crashes when plotting PNG with WorkerMicroStation

    I have implemented the IPrintManager code example from the MSTNPlatformNET.chm for plotting using an existing PltCfgFile The code for this is almost verbatim except that I load the PNG driver instead of the PDF driver, and that I've set publishingParams…
  • picking elements from reference files which are not active

    I am working on multiple reference files where I need to get the element Ids of the elements even if that reference file is not active. I am using the below code to pick elements. I am able to get elements that are from active reference file only, when…
  • [CONNECT Ed. 10.15.00.74 C# Addin] VS2019 Commands key-in not loading when following the basic example in the wiki

    I'm following the steps to create a new MDL addin using C# and I'm having an issue with getting the commands.xml to be recognized. VS 2019 (recommendation says for the below version to load VS2017 or higher for .NET programming) Microstation CE 10.15…
  • C# MS V8i SS3, form cut on another laptop

    good day in a Microstation addin (dll) I have a Form which I attach like this public static void startMaincoalTool(string unparsed) { MaincoalTool mcTool = new MaincoalTool(); mcTool.AttachAsTopLevelForm(Main.addin, true, "MaincoalTool"); …
  • C# Microstation V8i SS3 event when fully operational

    hi I have a two-module C# application, of which one is a Windows forms app and the second is a Microstation addin. The user opens Microstation from the Windows form, which is so configured that it automatically opens the desired dgn file. ProcessStartInfo…
  • C# .Net MSTN U16 - Reference File Treat as Element property

    Using MicroStation CONNECT U16 C# .NET trying to check and set the reference file property "Treat As Element" tick option. I can see DgnAttachment has Locate, Snap properties but cannot see the "Treat As Element" Is this Treat as Element option…
  • [CE U16 C#] Stand alone app opening DgnFile

    Hi, I'm attempting to open a DgnFile (in order to later inspect the geometry contents) using the following code: string fname = @"C:\Users\eaaz3620\Desktop\Testing\TestRead.dgn"; if (System.IO.File.Exists(fname)) { DgnDocument dgnDoc = DgnDocument…
  • C# .NET MS Update 16 View Attributes for Markers

    Using C# .NET MicroStation Update 16 I am looking to control the display of Markers in the View Attributes of each of the 8 views. Interop...Utilities.ComApp.ActiveDesignFile.Views[1]. gives me access to Fill On, Text On etc but no the Markers On…
  • [ C# ] Difference between MicroStation V8i SELECTseries 10 and CONNECT Edition update 15

    Is there a difference for C# MS_INITAPPS to run in MicroStation V8i SELECTseries 10 and CONNECT Edition update 15? Are all of the API calls from the add-in to MicroStation the same in both versions?
  • CONNECT C# How to update a text string in a Cell?

    I am trying to updated a Text Node containing a single Text Element inside a cell in a DGN file. Everything seems to work ok until I attempt to replace the existing cell with the modified version using the ReplaceInModel method. At that point the program…
  • How to close the form correctly?

    Hello everyone! I can't get to programmatically close the form. Each application form is made as described in this comment . Next, I want to close the form from the menu: private void CloseToolStripMenuItem_Click(object sender, EventArgs e) …
  • how to render solar light shadow to dgn file

    hello, i'm studying how to generate shadow of a solid exposed by solar light. i have got the interface of the default solar, and createed a new one to adjust some parameters, while i cant find the shadow in dgn file. i guess the shadow isnt rendered…
  • [CONNECT C#] Are unit tests possible?

    Hi, is it possible to cover methods with unit tests that refer to Bentley classes? If so, how could you do that? Actually, MicroStation must be running to load self-written classes. Best regards, Frank