Hi Simon, Having worked on a number of performance issue, I can ensure you that from a data monitoring and performance perspective Start of Work, Lunch (leave/return), and End of Work; along with backups/maintenance routines (typically after hours) will always have "trends" or spikes in activities during those periods of time. Typically it is best to involve your company's IT department (though an official help request) to have them monitor, assess, recommend, or improve those conditions for affected users. This is best addressed using specialized tools of the trade/device manufactures vs. creating (however useful) custom statistics you are trying to generate - in a format that can only show slowness, but not "what or why" aspects of the slowness those tools can provide quickly and efficiently. If you like, I have a working MicroStation VBA (template) event project ( MSVBAEvents.mvba ) that may be a better starting point for you to understand some very common MicroStation and Microsoft VBA events and the order in which they occur with basic timing information present. Feel free to use that information and redirect the logging output - local - since every network operation/packet requires successive and incremental time that can rob end-user/client performance. If you choose to use your existing example that Jon has been assisting you with, please consider writing that information local, then when complete push to your remote network drive (N:) since that will ensure best performance too. One last note I have observed often and recommend against is Not to store your user preference files on the network. User preference files are written to a lot (every dialog open/close/update) and all those packets add up to slowing down client performance. So consider keeping (your) user preference file(s) local where they can be updated with all your preferences extremely quick. HTH, Bob
↧
Forum Post: RE: Tracking time to open design files
↧
Forum Post: RE: selection of cells and processing
Hi Massimo, I ran your program and it looks good. Here are some suggestions. 1) As written, the program will always draw the between coordinates (0.0, 0.0, 0.0) and (0.0, 6.23, 0.0). Have you considered extracting the cell origin and using these as your points? This way the cells can be drawn anywhere and you will be able to calculate and draw the distance between them. cella(1).Origin is Point1 and cella(2).Origin is Point2. 2) I noticed that your transform function you convert back to degrees. I would keep the angle in radian measure until I need to report it. This way when you need to use the angle to calculate the rotation angle you don't have to remember to convert it. And in the transform function you can just multiply the angle = -1.0*angle to modify the angle when it is less than 0#. This is my preference when dealing with MicroStation.
↧
↧
Forum Post: RE: selection of cells and processing
Sure, but it wasn't clear from his first message that they were, or needed to be part of the same transaction.
↧
Forum Post: RE: [C#/mdl/V8i] link an excel spreadsheet in a dgn
Another way to do it you could use https://zetexcel.com/.
↧
Forum Post: RE: [C#/mdl/V8i] link an excel spreadsheet in a dgn
What benefit does Zetexcel provide that isn't provided better by GrapeCity Spread for COM ?
↧
↧
Forum Post: [CONNECT C++] WhereCriterion test for Boolean Property value
I can successfully test an Item Type property that holds a string value, using for example WhereCriterion::CreateStringFilter . I don't see a similar function for Boolean properties, although there is WhereCriterion::CreateNumberFilter for numeric properties. How do I create a WhereCriterion for a Boolean property value? Should I use CreateNumberFilter and pass 0|1 obtained from the Boolean value?
↧
Forum Post: [CE U10 MVBA] CreateTransientElementContainer1 question
Hello All, The following codes come from help: Sub ShowTransientElements1() Dim ele As LineElement Dim flags As MsdTransientFlags flags = msdTransientFlagsOverlay + msdTransientFlagsSnappable Set ele = CreateLineElement2(Nothing, Point3dFromXYZ(15.696, 25.045, -0.64), Point3dFromXY(20.194, 23.7592)) Set tec1 = CreateTransientElementContainer1(Nothing, flags, msdViewAll, msdDrawingModeHilite) 'Set tec1 = CreateTransientElementContainer1(ele, flags, msdViewAll, msdDrawingModeHilite) Set ele = CreateLineElement2(Nothing, Point3dFromXYZ(15.696, 23.759, -0.64), Point3dFromXY(20.194, 25.045)) tec1.AppendCopyOfElement ele End Sub Pay atttention to the codes CreateTransientElementContainer1, if the first parameter is Nothing, it works fine in V8i MVBA, but failed in CE U10 MVBA, it shows "Bad element". Can anyone help me to test it in CE U11? Thank a lot.
↧
Forum Post: RE: selection of cells and processing
good morning 1) I took into consideration the origin of the cell. But the macro is not finished. The file is 2d and I have to work also with the elevation that is written in the tag for which you prefer to read the tags. 2) I am used to working with centesimal angles and not radians even if it is easier. thanks a lot
↧
Forum Post: VBA macros
Hi Every one, Couple weeks ago we migrated to Windows 10. I have MicroStation and Promise*e installed in my PC, both select series-8. Since migrated to Win-10 I'm not able to run any mvba macro on my machine. I also tried third party macros but software is hanging and after few seconds exit. does any one help solving this problem. My submittals are getting delayed. best regards G.G. SIEMENS
↧
↧
Forum Post: RE: VBA macros
[quote userid="4701" url="~/products/programming/microstation_programming/f/microstation-programming---forum/175610/vba-macros"]Since migrated to Win-10 I'm not able to run any mvba macro[/quote] Most VBA macros, if they contain only VBA code, run fine when copied from MicroStation V8 i to MicroStation CONNECT. Reasons why a macro may not run on CONNECT include... Calls to COM libraries, such as Microsoft Scripting Runtime , that need updating Calls to MDL or Windows functions that require adjustment for 64-bit computing Without seeing your code it's impossible to provide a diagnosis.
↧
Forum Post: RE: Run VBA on Startup not working
Hi Bob, I have compiled the project and it has no issues. I have also gone through and ensured that each was Option Explicit. I am still having an issue getting the "Autorun" features to work. I have marked them for Autoload within the Project Manager but when opening and closing a file MicroStation seems to ignore the class altogether? Any other ideas for me to try?
↧
Forum Post: RE: Run VBA on Startup not working
[quote userid="823829" url="~/products/programming/microstation_programming/f/microstation-programming---forum/175248/run-vba-on-startup-not-working/507560"]I have also gone through and ensured that each was Option Explicit[/quote] One of the VBA IDE's options is to ensure that Option Explicit is alway specified . [quote userid="823829" url="~/products/programming/microstation_programming/f/microstation-programming---forum/175248/run-vba-on-startup-not-working/507560"]I am still having an issue getting the "Autorun" features to work[/quote] Loading and Running a VBA project are two different things. You are correctly using the Project Manager to specify auto-load. That brings your VBA project into MicroStation memory, but does not run it. There are at least two ways to run a loaded VBA project: maually tell MicroStation to run a procedure using VBA RUN [project]module.procedure , or automatically. MicroStation recognises your function name OnProjectLoad . If MicroStation finds that function when your project is loaded, it runs it automatically. Do whatever you need to do in OnProjectLoad . One thing you might do in OnProjectLoad is to create your DGN Events class .
↧
Forum Post: RE: VBA macros
Hi, [quote userid="4701" url="~/products/programming/microstation_programming/f/microstation-programming---forum/175610/vba-macros"]I have MicroStation and Promise*e installed in my PC, both select series-8.[/quote] please follow best practices and specify exactly what versions do you use (build numbers), because there is nothing like MicroStation select series-8. The latest MicroStation V8i released was V8i (SELECTseries 4). [quote userid="4701" url="~/products/programming/microstation_programming/f/microstation-programming---forum/175610/vba-macros"]Since migrated to Win-10 I'm not able to run any mvba macro on my machine[/quote] What does it mean exactly? Is there any error message? Can you try MicroStation VBA macro in MicroStation only, without Promis*e running? [quote userid="4701" url="~/products/programming/microstation_programming/f/microstation-programming---forum/175610/vba-macros"]does any one help solving this problem.[/quote] VBA engine is external to MicroStation, so usually when there are problems with VBA, the installation has been corrupted, e.g. VBA dlls are not registered properly in Windows, so MicroStation is not able to use them. Did you try to repair MicroStation installation? With regards, Jan
↧
↧
Forum Post: RE: [CE U10 MVBA] CreateTransientElementContainer1 question
Hi Changsong, the same problem (bad element) reported also in Update 11. Should be logged as defect. With regards, Jan
↧
Forum Post: Batch processing OpenDesignFile vs OpenDesignFileForProgram
I have a batch process that opens files detached references and then compresses the file before moving onto the next file. You guys on here helped me put this code together and I thankyou. The problem I am having now is that some of the files don't want to oblige and are causing System Memory issues or just crashing. I have used this code on both AECOim V8i Ss6 and AECOsim CONNECT edition, both experience the same issues. I was wondering would I run into less memory issues if I used OpenDesignFileForProgram and would I be able to carry out detaching reference files and compression in this mode. There are just under 300 files that I am trying to process and I am trying to run this overnight when the files are not in use. Option Explicit Sub processDGN() Dim sPath As String Dim sListName As String Dim FFile As Long FFile = FreeFile Dim sCurrentFile sCurrentFile = ActiveDesignFile.FullName sListName = "F:\IOP\EW\02_Plant\03_Design\01_Models\0-EW-MODELS.txt" Open sListName For Input As #1 Do While Not EOF(1) Line Input #1, sPath sPath = Trim(sPath) Debug.Print sPath If Len(Dir(sPath)) > 0 Then ' simple check if file exist processing sPath End If Loop OpenDesignFile sCurrentFile, False ' reopen the previous file End Sub Sub processing(sPath As String) Dim oDGN As DesignFile Set oDGN = OpenDesignFile(sPath, False) processModels End Sub Sub processModels() Dim myModel As ModelReference For Each myModel In ActiveDesignFile.Models myModel.Activate detachRefFile Debug.Print myModel.Name Next CadInputQueue.SendKeyin "compress design; compress options on ALL" End Sub Sub detachRefFile() Dim refAttachments As Attachments Set refAttachments = ActiveModelReference.Attachments Dim currentRef As Attachment For Each currentRef In refAttachments If IsCandidateForDetach(currentRef) = True Then Debug.Print currentRef.AttachModelName ActiveModelReference.Attachments.Remove currentRef End If Next End Sub Public Function IsCandidateForDetach(ByVal oAttachment As Attachment) As Boolean IsCandidateForDetach = False Debug.Print oAttachment.AttachName If oAttachment.IsMissingFile Then IsCandidateForDetach = True ElseIf oAttachment.IsMissingModel Then IsCandidateForDetach = True ElseIf Not oAttachment.ElementsVisible Then IsCandidateForDetach = True ElseIf oAttachment.NestLevel > 0 Then IsCandidateForDetach = True End If End Function Sub compressDesign() Dim oDGN As DesignFile Set oDGN = OpenDesignFile(sPath, False) CadInputQueue.SendKeyin "compress design; compress options on ALL" End Sub
↧
Forum Post: RE: Batch processing OpenDesignFile vs OpenDesignFileForProgram
[quote userid="966590" url="~/products/programming/microstation_programming/f/microstation-programming---forum/175635/batch-processing-opendesignfile-vs-opendesignfileforprogram"]I was wondering would I run into less memory issues if I used OpenDesignFileForProgram and would I be able to carry out detaching reference files and compression in this mode[/quote] No. When you OpenDesignFileForProgram there are no references. There are a number of resources unavailable that are normally available when you OpenDesignFile . Look at it like this: when you OpenDesignFile you have done the same as File|Open in MicroStation. When you OpenDesignFileForProgram you have done exactly that, not opened a design file for a user. [quote userid="966590" url="~/products/programming/microstation_programming/f/microstation-programming---forum/175635/batch-processing-opendesignfile-vs-opendesignfileforprogram"]AECOim V8i Ss6 and AECOsim CONNECT edition, both experience the same issues[/quote] Please elaborate on 'the issues'. Can you post your error messages? Do you see the same issues when you run your VBA on the active DGN file rather than batch mode?
↧
Forum Post: [VBA V8i] Turning Off PDF Layers via Macros - Can it be done?
I tried recording a macro, but it only recorded a key-in to open the PDF Layers dialog box, but it did not record any dialog events. As my MDL skills have really atrophied, I was hoping someone may have the knowledge of some wrapper function that we could use. TIA
↧
↧
Forum Post: vba onloadproject unloading microstation ss4 windows 10 build 1803
We have starting getting new pc's with windows 10 build 1803. Our vba drawing tools are causing mirostation to unload. the tools run ok in windows 7 & windows 10 build 1703. the onprojectload method seems to me crashing microstation ss4. Do we need to download a windows update? is anyone else seeing this issue?
↧
Forum Post: RE: [VBA V8i] Turning Off PDF Layers via Macros - Can it be done?
Hi Chuck, [quote userid="5740" url="~/products/programming/microstation_programming/f/microstation-programming---forum/175649/vba-v8i-turning-off-pdf-layers-via-macros---can-it-be-done"]I was hoping someone may have the knowledge of some wrapper function that we could use.[/quote] I think there is no API to access PDF layers. The only MDL function that mention "raster layers" is mdlRaster_systemRasterContainerGet, but it's not clear what "layers" mean in this case and the function itself is more an entry point to mdlCntr_ functionas. With regards, Jan
↧
Wiki Page: MicroStation CONNECT SDK - Introduction
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
↧