Quantcast
Channel: MicroStation Programming
Viewing all 25671 articles
Browse latest View live

Forum Post: RE: [CONNECT C++] How do I highlight a component of a cell like Element Information does?

$
0
0
Hi Piers, may this discussion (and possibly other about ElementAgenda) help you? Regards, Jan

Wiki Page: MicroStation CONNECT SDK - Introduction

$
0
0
MicroStation CONNECT Edition is one of the largest software undertakings Bentley has taken since the initial release of MicroStation V8. This special edition of the BDN Newsletter will provide an overview of what programming options are available in the new MicroStation CONNECT Edition and MDL SDK. Please take a moment to review the detailed contents of this extended newsletter. Questions regarding support issues for the MicroStation CONNECT Edition SDK should be posted in the Bentley Communities MicroStation Programming Forum . Programming Options with MicroStation CONNECT Edition Whether you are a MicroStation user, CADD administrator, someone interested in getting started with programming in MicroStation, or an intermediate to advanced software developer; MicroStation CONNECT Edition provides everyone options suited toward your individual level of experience and needs. The graphic below helps illustrate each of the options available, what knowledge each solution requires, and the progression users with no programming experience can work towards someday creating the most robust MicroStation programming solutions possible. MicroStation CONNECT Edition SDK Overview The following sections describe new features within the new SDK. It should be noted that MicroStation CONNECT Edition SDK requires Microsoft Visual Studio 2013. Reorganized and Refactored: APIs, includes, and libraries The MicroStation CONNECT Edition SDK now installs as a "stand-alone" product separate (yet dependent) on the MicroStation parent product. Allowing developers to install multiple versions of the SDK side-by-side or install to custom locations that meet your individual needs or requirements. MicroStation APIs, includes and libraries have been reviewed, organized, and isolated, to help ensure a new level of improved consistency between native and managed APIs opening up new API possibilities. Completely New: Native MDL C++ and Managed MDL .NET APIs Within the new SDK you will find, a comprehensive set of MDL C++ API libraries you can more fully leverage within Microsoft Visual Studio 2013; apply elegant C++11 coding styles and techniques, STL programming, and much more. MDL .NET APIs are a thin managed wrapper around the high performance MDL C++ libraries and use similar library and terminology naming conventions. The new .NET managed API assemblies are no longer based on MicroStation VBA’s – Microsoft COM object model. This more direct level of access ensures improved performance and reliability; as well as more accurate error messages. Leverage MicroStation's GUI administrative tools to make creating and designing common UI components with ease. Choose to extend your application UI using your choice of preferred UI development APIs; like: Bentley's MDL native dialog manager Microsoft's native MFC, WinForms, or WPF APIs Enhanced: MicroStation Developer Shell . The development environment has been improved to be more developer-centric and friendly. The MicroStationDeveloperShell.bat (previously known as: mstndevvars.bat) has received a complete refresh providing useful environment troubleshooting information and the ability to perform your own or shared custom pre and post processing actions via " MicroStation Developer Shell Extensions " The MicroStation Developer shell title bar can quickly determine: If you are using a 64-bit or 32-bit Microsoft command shell (cmd.exe) If you are running as an administrative user The Microsoft Visual Studio required for the MicroStation version you are developing for Pathing includes the standard development tools and the new MigrationTools Updated: Many new code samples A number of new MDL programming samples are available to explore and learn, as well as, an improved organization of samples using easy to identify categories of application development. It is now easier to find what you need with even more samples to come! A "legacy" MDL samples directory is provided as a point of reference when performing 1:1 application migrations. Exploring the new API programming samples and documentation, ensures you will find practical, modern, and preferred coding samples using the most recent MicroStation APIs. Updated: API Documentation The MDL SDK documentation has undergone a large number of changes. Some of the changes and additions to the SDK documentation are: API documentation is automatically generated as part of our product build process, directly extracting developer comments embedded within the API header files, and a list of expanding documentation Contents and Articles. Bentley developers are now able to provide quick and consistent documentation changes for the next release all right from within their source code editor. API documentation implements an improved organizational layout strategy providing and improving consistency and organization of content. MicroStationAPI.chm - A convenient single help file that allows you to explore documentation for both the MDL native C++ and C APIs. Since the documentation is derived directly from the include files, this makes it convenient to search in one spot a less frequently search include directories directly. TIP: Make sure to check out a number of new and updated MDL API topics located under: "Modules > Contents & Articles" DgnPlatformNet.chm - A convenient single help file that allows you to explore managed code documentation for the MDL DgnPlatformNET API and namespace, DgnEC, and Elements. New: MigrationTools The MigrationTools directory contains remapping tools that allow you to begin the process of porting existing MDL application code to MicroStation CONNECT Edition. A majority of MDL developers are likely to take a 1:1 migration path first. The MigrationTools directory provides a convenient starting point to remap (search and replace) over 2800 common items within your project source code files. Consider using migrate.bat as your first pass in a 1:1 migration. Since it performs these common, repetitive, and possibly error prone tasks: Create a zip file of all files (and child folders) under the current directory Locates a list of all current valid source code files to process Modifies each file directly with search and replace actions defined in the delivered .remap (regular expression file) Creates MigrationReport.txt a report containing (the number of) changed items (per file), start and finish times, or troubleshooting information if errors occur Please note: the MigrationTools require the download and installation of Python 2.7 . The resulting Zip file generated is not intended to replace a well-founded backup solution or strategy. Always make sure to back up your source code and/or source code management system data regularly Overview: Migration Tools The MigrationTools directory provided in the MDL SDK is an entry point to help developers get started when performing a 1:1 source code migration of existing MicroStation V8 MDL applications to MicroStation CONNECT Edition. As with all source code projects, a good backup and branching strategy is highly recommended prior to performing bulk or unintended edits of your source code files necessary when migrating to a new product version. With that said and your backup complete, let's take a look at the purpose of Migrate.bat and the delivered files and their purpose. Migrate.bat Validates MSMDE being defined (standard when run from the MicroStation Developer Shell), otherwise logs the current environment variables for your or peer review in the log file: MigrationReport.txt Validates Python 2.7 being installed, otherwise logs the current environment variables and decision when prompted to download and install a compatible version. Performs a recursive zip archive of all files under the current parent project directory. Performs a recursive search of all valid source code file extensions; currently: .c .cpp .h .fdf .hpp Calls Python.exe passing the following arguments: ApiRemapper.py . The overall python script that performs source code file remapping 0811to1000Published.remap . The regular expression search and replace (remap) file SourceCodeFileSpec . The full path, name, and file extension (FileSpec) of a valid source file to remap Opens MigrationReport.txt using your default .txt source code editor. The top section of the report provides: Processing Start Time Search path and method used to find Python 2.7. e.g. Registry or OS Path The bottom section of the report provides Start/Finish Times Number of valid source code files processed Summary list of modified files and number of edits performed NOTES: If a prior zip file in the naming convention of ParentDirectoryName.zip is encountered the file will be renamed to include the Current Time backup was performed as part of the new file name, then the current project files will be added to ParentDirectoryName.zip. A future update will likely change the behavior to rename the file to use the LastModified date and time of the original file vs. the current method. After running Migrate.bat and reviewing the report results your next step will be to attempt to compile each migrated application under your parent project. If you have not done so, we highly recommend to confirm the integrity of your development environment by compiling one or more of the delivered MDL example projects (e.g. ..\examples\buildallexamples.bat ) from the MicroStation Developer Shell . Once you can compile the delivered examples you should attempt to compile one of your applications with confidence having been processed by the MigrationTools. Please note that unless you have the most basic app, you can and should expect to make several iterative passes: compiling, searching includes and forums, making edits, and re-compile; until you finally have an MDL application converted and ready to run in MicroStation CONNECT Edition. This process is typical of what application developers are required to perform when migrating a source code project from a major version change of product; like when going from MicroStation v08 to MicroStation v10. Applying the steps above should help provide a productive first step to assist in your migration efforts. Depending on your application complexity, substantial product and API changes and your need for input and guidance, or skills and timelines; below are some relevant links for finding some additional assistance. MicroStation Programming Forum Bentley Professional Services Resources Whether you are new to MicroStation Programming or the BDN program, or a seasoned developer familiar with both; it is good to have a list of high-level links to make sure you can find the right information you need quickly. Below is a list of useful links to help get you started in the right direction. Please note the second set of links requires BDN membership to obtain access. BDN - Bentley.com BDN – Bentley Communities (Private Community) BDN Learning Paths for Success BDN News Published APIs and SDKs for various Bentley product Bentley Communities - Programming Forums MicroStation Programming Wiki

Wiki Page: Developers Migrating to MicroStation CONNECT

$
0
0
Use this page to learn about the latest software and SDK resources available. Overview (Users, Admins, Developers) Say Hello to MicroStation CONNECT (User Information on Bentley CONNECT software and services) Advancing to CONNECT Edition (User/admin Getting Started migrating information) MicroStation Blogs (New Features and Updates for this software edition) Developers MicroStation CONNECT SDK - Introduction MicroStation CONNECT SDK - YouTube Videos ( Download the SDK , Install the SDK , Developer Shell Overview )

Wiki Page: Tasks

$
0
0
Workflow Tasks related to source code migration.

Wiki Page: Workflows

$
0
0
Workflows, Topics and Considerations related to source code migration. Migrate V8 MDL Code Some helpful getting started links to assist developers migrating v8 code to CONNECT: Developers Migrating to MicroStation CONNECT MicroStation CONNECT SDK - Introduction ( MigrationTools ) Migrating MDL Applications To Native Code

Forum Post: RE: [CONNECT C++] How do I highlight a component of a cell like Element Information does?

$
0
0
[quote userid="14893" url="~/products/programming/microstation_programming/f/microstation-programming---forum/177609/connect-c-how-do-i-highlight-a-component-of-a-cell-like-element-information-does"]What is the correct way to handle this simple task?[/quote] While the solution in the thread Jan linked is useful, it doesn't exactly answer your question... How do I highlight/unhighlight an individual element? How do I highlight/unhighlight an individual component of a complex element? The ElementAgenda.Hilight/ElementAgenda.ClearHilight is useful for multiple elements. Though I suppose you could populate an ElementAgenda with a single element and use those methods.

Forum Post: RE: [CONNECT C++] How do I highlight a component of a cell like Element Information does?

$
0
0
Hi Jon / Jan, I've also tried using ElementAgenda and once again it highlights the whole cell and not the component. I am using the ElementID to find the elementRef of the component and passing that into the ElementAgenda. Hilite () call. I've verified the component is valid. I created an empty design file from scratch, placed some elements and grouped them into an orphan cell, so there's little chance it is corrupted DGN data that causes it. It just seems to be a limitation in all of the public API's that they won't display complex components without displaying the whole cell. And yet, the standard MicroStation tool shows it is possible...

Forum Post: RE: Modify Working Unit Settings via VBA or Key-in

$
0
0
Jan, so hate to ask, I know how to open help F1, or I know how to open VBA project manager>open visual basic editor and then the help. But do not know how to load or open the Microstation VBA help. Is is possible you would tell me or give me a link. I have been checking ? I even did a search on the communities > Search and put in for sure I am missing something. Any other information you would pass on?

Forum Post: RE: Modify Working Unit Settings via VBA or Key-in

$
0
0
Hi Richard, [quote userid="376145" url="~/products/programming/microstation_programming/f/microstation-programming---forum/174789/modify-working-unit-settings-via-vba-or-key-in/514889"]But do not know how to load or open the Microstation VBA help[/quote] did you try use F1? When used for "standard VBA" (cursor is on e.g. Then or Sub keyword), Visual Basic Reference is opened. When used for keywords specific for MicroStation VBA API (e.g. TextElement or CadInputQueue), MicroStation V8 VIsual Basic for Applications help is opened. [quote userid="376145" url="~/products/programming/microstation_programming/f/microstation-programming---forum/174789/modify-working-unit-settings-via-vba-or-key-in/514889"]Is is possible you would tell me or give me a link. I have been checking ?[/quote] The most simple way is to simply search MicroStation installation, e.g. using Windows Explorer to search MicroStation folder (usually MicroStation V8i (SELECTseries)\MicroStation\) for *VBA*. It gives you a couple of findings... ... and voilà ... MicroStationVBA.chm is found in the same folder where ustation.exe is located. With regards, Jan

Forum Post: RE: [V8i C#] Changing the New tag on an element.

$
0
0
[quote userid="2473" url="~/products/programming/microstation_programming/f/microstation-programming---forum/177535/v8i-c-changing-the-new-tag-on-an-element/514541"]To change the value, I guess you can use available wrappers around mdlElement_setProperties or mdlElmdscr_setProperties. Consult MDL documentation for exact declaration of VBA wrapper, that can be used also in C# (using [DllImport("stdmdlbltin.dll")] attribute), not only in VBA.[/quote] This does indeed seem like the way to go, but i'm unsure of what the values i need to give the MDL command. Right now i have function that looks as following: public static extern int mdlElement_setProperties(out BCOM.Element element, UInt32 level, UInt32 ggNum, int elementClass, int locked, int newElm, int modified, int viewIndepend, int solidHole); I tried changing the newElm tag to booth 1 and 0, but neither seemed to have any effect on the Element in microstation.

Forum Post: RE: [CONNECT C++] How do I highlight a component of a cell like Element Information does?

$
0
0
Hi Piers, [quote userid="14893" url="~/products/programming/microstation_programming/f/microstation-programming---forum/177609/connect-c-how-do-i-highlight-a-component-of-a-cell-like-element-information-does/514886"]I've also tried using ElementAgenda and once again it highlights the whole cell and not the component.[/quote] Thanks for your, despite of "negative", confirmation. For me it's quite important information, because I have also couple of tools where the same functionality exists and some from them are planned to be migrated on CE platform too. [quote userid="14893" url="~/products/programming/microstation_programming/f/microstation-programming---forum/177609/connect-c-how-do-i-highlight-a-component-of-a-cell-like-element-information-does/514886"]It just seems to be a limitation in all of the public API's[/quote] I hope Robert Hook or Brien Bastings will help. I'd like to see it will not end in API description, but in "how to highlight element best practice" that can be step by step extended for different scenarios both in terms of context (element location, where it's automatic, or explicitly like in the discussed case), element location (active model, reference) and element complexity (simple element, the whole complex element, one element from complex element...). It's what I am missing in API documentation more than lenghty description of particular classes and methods ... but it's for another discussion ;-) With regards, Jan

Forum Post: RE: [V8i C#] Changing the New tag on an element.

$
0
0
Hi Nikolai Bo, [quote userid="1006514" url="~/products/programming/microstation_programming/f/microstation-programming---forum/177535/v8i-c-changing-the-new-tag-on-an-element/514900"]This does indeed seem like the way to go[/quote] From reasons mentioned below I think it's simpler to use mdlElmdscr_setProperties instead of mdlElement_setProperties. [quote userid="1006514" url="~/products/programming/microstation_programming/f/microstation-programming---forum/177535/v8i-c-changing-the-new-tag-on-an-element/514900"]but i'm unsure of what the values i need to give the MDL command[/quote] To use P/Invoke to call C functions from C# looks sometimes weird and tricky, but it's not magic ... but when used ocasionally, it often requires a few tries to write working code ;-) But it's based on exactly defined rules. I recommend to study (or at least to store somewhere) these documents: Interop Calling convetions Marhsalling data types ... I guess the most important specs P/Invoke web Calling DLL functions from VBA chapter in MicroStation VBA help MdlExamples.mvba delivered with MicroStation installation ... and of course MDL API documentation with declarations of C functions and their VBA wrappers There are also plenty of discussions about P/Invoke on StackOverflow and articles on CodeProject.com. [quote userid="1006514" url="~/products/programming/microstation_programming/f/microstation-programming---forum/177535/v8i-c-changing-the-new-tag-on-an-element/514900"]I tried changing the newElm tag to booth 1 and 0, but neither seemed to have any effect on the Element in microstation.[/quote] Well, it's not surprise, in my opinion there is an error in your call. I am surprised MicroStation does not crash ;-) You have to use proper data types. Check what is defined in marshalling table; where MicroStation data type is used, VBA doc and examples often help (which is a bit surprise, because it looks weird to use VBA doc to define proper call C function from C#, so it usually cannot be used 1:1). Problems I see in your call is in MSElement* declaration:C MSElement* is not NET Element, but pointer, so integer! This is crucial to understand using P/Invoike you are crossing borders between native memory (managed by native MicroStation kernel) and managed memory (managed by NET Garbage Collector). I am not sure whether there is a direct way how to obtain MSElement* from Interop Element object, but it seems there is an example how to do it in MdlExamples.mvba. Because it's simple to obtain element descriptor pointer from NET Element object, I think you can try to use mdlElmdscr_setProperties function (not tested, just what I think maybe a right way): private static extern void mdlElement_setProperties(ref int msElementDescr, UInt32 level, UInt32 ggNum, int elementClass, int locked, int newElm, int modified, int viewIndepend, int solidHole); where int mdlElmDscr = el.MdlElementDescrP(true); UInt32 levelId = (UInt32)level.ID; I am not sure whether for attributes you do not want to modify it's correct to use 0 or it's necessary to use IntPtr.Zero. With regards, Jan

Forum Post: RE: Modify Working Unit Settings via VBA or Key-in

$
0
0
[quote userid="376145" url="~/products/programming/microstation_programming/f/microstation-programming---forum/174789/modify-working-unit-settings-via-vba-or-key-in/514889"]How to load or open the Microstation VBA help?[/quote] Look at this article about VBA help . Once you've located that .chm file, use Windows to create a shortcut (right-click) and place that shortcut on your Windows desktop.

Forum Post: RE: [V8i C#] Changing the New tag on an element.

$
0
0
[quote userid="2473" url="~/products/programming/microstation_programming/f/microstation-programming---forum/177535/v8i-c-changing-the-new-tag-on-an-element/514927"]Because it's simple to obtain element descriptor pointer from NET Element object, I think you can try to use mdlElmdscr_setProperties function (not tested, just what I think maybe a right way):[/quote] Hi Nikolai, As far as I know, the flag could set by this function, or you could even go the dangeros path to flip this value directly in the c-structure. But after you ask the SDK to add (write) or rewrite the element, the property is set to whatever Bentley thinks is the right value. Thats why it is a readonly property. The question is: Why would you like to trick? With regards Volker Hüfner

Forum Post: RE: scan GroupedHoleElement

$
0
0
[quote userid="2269" url="~/products/programming/microstation_programming/f/microstation-programming---forum/177583/scan-groupedholeelement/514727"]In addition to Jan's comments, you should note that a Grouped Hole is an anonymous cell.[/quote] Well, it goes a bit beyond original topic, but in my opinion it's something that has not been important and should not be used in C++ API. So my comment is more about "API style and philosophy" than about how to implement working, despite of old-fashined, code. My understanding of MicroStation C++ API and a move that begun long time ago when the new API was introduced in V8i SS3 (if I remember correctly) has been about move from data structures and data storage details (MSElementDescriptor, desing file element types, different ways how cells are used to represent cell, groupped elements, groupped holes, SmartSolids etc.) to higher level of abstractions (ElementHandlers). From this reason I think any new code should not depend on element type evaluation and to check how specific object is stored in repository. Regards, Jan

Forum Post: RE: scan GroupedHoleElement

$
0
0
[quote userid="2473" url="~/products/programming/microstation_programming/f/microstation-programming---forum/177583/scan-groupedholeelement/514956"]higher level of abstraction[/quote] You're right: I found the GroupedHoleHandler Struct in MicroStationAPI help... A grouped hole is a sub-type of cell . A grouped hole cell must have a first child that is a closed curve with solid area type followed by at least one closed curve with hole area type. Displays fill using parity rules.

Forum Post: RE: [V8i C#] Changing the New tag on an element.

$
0
0
Right now we are trying to digitalize a rather big dataset. The problem is we quite often find that elements are not probberly saved in our Database that we connect to via microstation. When an element is saved in the DB, the "new" tag i set to not new(false), but for some reason, we find ourselves in a situation where microstation tries to save data, fails to do so, but still set the tag of the element to not new. This means that we now have unsaved data, that microstation thinks has been saved in the DB(because of the new tag). This means we have incomplete data in our DB, because mircostation use the new tag to figure out which items to save to the DB. We still get the error that not all data from the current workflow has not been saved in the database, so we would like to find these elements, and reset the new tag back to being new, so we can try to save the data again.

Forum Post: RE: scan GroupedHoleElement

$
0
0
[quote userid="2269" url="~/products/programming/microstation_programming/f/microstation-programming---forum/177583/scan-groupedholeelement/514961"] A grouped hole is a sub-type of cell .[/quote] Yes, that's correct ... now and how it's implemented on top of DGN format. (I know it's just my crazy assumption ;-) but in future, when storage format will change, code based on GroupedHoleHandler will remain the same (because there is zero dependency on data persistence implementation), but code based on assumption it's the cell and working in a way to "cast" handler to CellElement and working with elements individually become obsolete and will stop work. Regards, Jan

Forum Post: V8i COM/VBA - Activate and dectivate reference destroys attachments object?

$
0
0
Hi together, I've noticed some strange behaviour when I activate and deactivate a reference file and want to figure out if it's maybe a bug. I'am using MicroStation V8i SS3 with a master.deg with two references (ref.dgn and b.dgn). I do the following steps: Start VBA Editor and run a Test Sub ( set a watch to Application.ActiveModelReference.Attachments.Item(1) ) --> values are fine activate ref.dgn deactivate ref.dgn Run Test Sub again --> values of attachment ar no longer valid ( ) after step 1: after step 4: Do I have to refresh something? If I don't run the Sub before activating and deactivating the object is fine too. Kind regards Marcel

Forum Post: RE: V8i COM/VBA - Activate and dectivate reference destroys attachments object?

$
0
0
Hi Marcel, it seems COM API is not updated fully when activate / deactivate process is finished. It seems the problem is the same for V8i and CONNECT Edition, I am not aware of any simple solution or workaround. Artur Goldsweer would you be so kind and to check this issue? With regards, Jan
Viewing all 25671 articles
Browse latest View live


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