Browse By Tags

  • [MSCE C#] how to set Global Origin

    hi I am trying to place an element in C# Addin .Net, but since the default global origin of the seed file is not (0,0,0). I am unable to place the element at the correct coordinates. I tried to change the global origin with this code, but it didn't…
  • Is it possible to import dgn files to a active dgn file as models in C#

    I would like to find a way to import dgn-files (models) from folder to a active dgn as models using C#
  • Fence only interact with specific element types

    Hello All, I have written a routine to generate a shape from a series of points and then utilize the shape to define a fence from element. I would like to process the fence in two separate routines one that will clip normal element type like Lines…
  • [CONNECT Update 17 C#] Navigating a TextBlock

    TextBlock Class From the DgnPlatformNet help document: In the TextBlock DOM, this is the master object that represents a piece of text as a whole, and is the primary high-level object used to deal with multi-line, formatted text (and is also generally…
  • How to harvest custion file properties (dgn file) in Microstation C# Addin

    Hello all, I would like to read the Custom File Properties from a DGN file. The image above shows the custom file property 'MY_PROP', which I would like to want to read out. My previous approach (via DgnECInstanceCollection) was unfortunately unsuccessful…
  • [CONNECT Update 16 C#] Get a DgnFile and DgnModel by Name

    I want to create a new DGN model by opening and reading an existing DGN file. The object is to get a reference to a seed DgnModel to use when creating a new DgnModel . DgnFile.CreateNewModel looks like the right method, but requires a DgnModel reference…
  • [MSCE U16 DgnPlatformNet] Elements stored beyond an "Undo" operation are being replaced by new elements

    We are plotting elements and storing them in a List for reference.. What we have noticed is that when the elements are undone, the "IsDeleted" property becomes True and the IsValid property become false as expected.... However, once we add a new element…
  • How to get selected element id and display it in WPF form in Bentley.MstnPlatformNET.AddIn

    Hi I just started with MicroStation so forgive me my ignorance. ;-). I have C# Bentley.MstnPlatformNET.AddIn with WPF form that is displayed through "mdl load xxxx" I need to be able to click on drawing (.dgn) and read element id property that is selected…
  • [CE U16 C#] Get the Microstation version by code

    Dear Community, Is there a way to retrieve the Microstation version number through C#? Thank you in advance! Best regards, Ivan
  • [CE U16 C#] Read all references (nested also) and their respective file location

    Dear Community, I am trying to read all references including the nested ones from a DGN file. However, I always end up with only first-level references and I can not go deeper. Here you can see one pice of code that returns only the first level references…
  • [CONNECT Update 16 .NET] ChildElementCollection: How to Update Child Element

    I'm trying to make ChildElementCollection work using C#. I want to modify a cell by assigning a level to a line within that cell. I read the cell, iterate its children, modify the line, then rewrite the cell. Here it is in C#... private bool AssignLevel…
  • [CONNECT Update 16 C#] Level Change Events

    I establish an event change handler in my AddIn ... protected override int Run(string[] commandLine) { SetupEventHandlers(); return 0; } void SetupEventHandlers () { s_Addin.LevelChangeEvent += LevelChangeHandler; } Then react to events in LevelChangeHandler…
  • [MicroStation CONNECT Update 16 C# WPF] Is dynamic toolbox possible?

    Hello, folks! For once, SDK has a rather extensive example for programming WPF applications. This example is called WPFdemo. Here you can open a dockable toolbar with 'wpfdemo open5'. So far so good. But now I would like this toolbox to behave like…
  • [CONNECT Update 15 C#] Refreshing UI after opening new file

    Hello I made addin application in c#. I created a window in MVVM pattern so ui is made in XAML file and then attached to DockableToolbar as it was in example: public class DockToolbar : DockableToolbar, BMG.IGuiDockable { static private DockToolbar…
  • [CONNECT C# Update 16] Create Text-Element and InterCharSpacing resp. CharacterSpacingValue

    Hi, I would like to specify the value for InterCharSpacing or CharacterSpacingValue when setting a text. The value '100' entered here does nothing. I could also omit the respective lines. Is there anything missing here, or is this the wrong approach…
  • [C# CONNECT Update 16] Automatically create complex shape when the maximum number (5000) of vertices for a shape element is exceeded

    Hello, As you know, a shape stops at 5000 vertices. When this limit is reached, I want my method to automatically create a ComplexShape. Here is an excerpt from my source code, where this works with <= 5000 for pure Shape elements. With more than 5000…
  • IBMECObject.GetDoubleValue api is no longer available from Bentley.Building.Mechanical.Components

    Hi community, we're upgrading C# code for OPM V8 SS5 edition to OPM CE (upgrade 9). The IBMECObject.GetDoubleValue method is no longer available and there are some others the gets values in specific unit (ie GetDoubleValue InMM, GetDoubleValue InUors…
  • 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…
  • [CONNECT UPDATE 15 C#] NotificationAdministrator

    Hello, I wanted to catch messages from notification panel of microstation. I can catch messages with green underline with AddIn.MessageCenterWriteEvent. But I can't catch message with red underline. I found NotificationAdministrator with description…
  • [CONNECT UPDATE 15 C#] LineStyle Scale

    Hello, I have problem with setting scale for linestyle in c#. If anyone found working solution please share it. So far I tried to use ElementPropertiesSetter SetLineStyle function because this function takes LineStyleParameters as param but i can…
  • BentleyView Initialization in C#

    Hi, I am trying to initialize BentleyView application in my C# Class Library using 'Bentley.Interop.MicroStationDGN'. Following is the snippet I am using: private Application application; public Class1() { ApplicationObjectConnector…
  • [CONNECT C#] Create Associated Dimension to Sub-Element within Shared Cell Instance

    Hello, I need some help to programmatically add dimensions into a 3D model where the dimension vertices are associated with edges or vertices of on or more smart solids contained within shared cells. This is easily accomplished manually however, due…
  • [CONNECT C#] Text element insert field

    Hello everybody, how we can to add a field to a text element with the value of its ItemType property like Insert field option from Text editor dialog (see image)? It is possible in C#? many thanks,
  • [C#, VB.net CONNECT Update 13] CreateDesignFile method causes an exception

    Gents, I’m looking for solve an issue that occur in the following conditions: a WPF Microstation Connect AddIn developed in C# is running an external application (developed in vb.net) call the method Application.CreateDesignFile as follows: …
  • C# Connect modify textnode element

    When editing a text element and text node element using its TextBlock along with ParagraphProperties and RunProperties, the changes get replaced in the text element but not in the text node element. Not sure why the TextEdit.ReplaceInModel not working…