Hi Justin, my exprience with 3D mesh API and related data structures are limited, but the question sounds not correct, because it reverses dependency chain (a cause and consequence). The normal (just my guess) is always contructed with right-hand orientation and the normal orientation expresses what is "inside" and "outside". How a face vertices are oriented ((counter)clockwise) depends on a context what is treated as outside/inside. When a new closed mesh or solid is created, I suppose all normals points outside, so the loops will be counterclockwise oriented. But I am not quite sure what the result will be in more complicated cases when a new solid is created as a result of Boolean operation, e.g. using subtraction. And regardless how a new object is created, there are tools in MicroStation that allow to reverse normal manually (in CE Update 6 new tool for meshes will be added) and in such case I guess also vertices orientation will change. With regards, Jan
↧
Forum Post: RE: [CONNECT C++] DGN mesh model face loop orientation
↧
Forum Post: RE: [CONNECT C++] DGN mesh model face loop orientation
Thank you, Jan.
↧
↧
Forum Post: RE: [CONNECT C++] The API change in the new toolkit
Hi Danny, [quote user="danny zhu"]We do have a contract with Bentley so there should no license concerns. [/quote] Thanks for explanation, such conditions makes the whole situation and usage clear and simple :-) [quote user="danny zhu"]since my understanding v8i toolkit should be 32bits only but our toolkit is 64bits.[/quote] Anything 32bit is V8 i based, 64bit always originated at MicroStation CONNECT Edition, because there is no 64bit V8 i version and vice versa no 32bit of CONNECT Edition exists. [quote user="danny zhu"]then I would think we better wait for update5 to use the latest toolkit.[/quote] I agree it seems to be the best solution. It's probably not so important whether it will be Update 5 or Update 6, because the big change (migration from VS2013 to VS2015 C++ runtime) was implemented in Update 5 and I guess it will be maintained for some time now. Regards, Jan
↧
Forum Post: RE: [CONNECT C++] The API change in the new toolkit
Thank you Jan, that helps a lot to us. -Danny
↧
Forum Post: RE: how to move dimension text location programmatically (C# / VBA)
Hi Ram, dimension text behavior is defined by dimension style. I recommend to test a proper dimension style setting manually. To change the dimension from the first to the second one, I assume more configuration have to be changed (Fit Options in Geometry, Text Justification etc.). After you will now the right values, you can: To change them individually for every dimension element. To define new dimension style and to assign it to all dimensions. In my opinion this option is better because more systematic. With regards, Jan
↧
↧
Forum Post: RE: Upgrading V8i MDL Apps to Connect
Hi John, I agree with Jon the migration of a code to CONNECT Edition is not very simple one step process. You did not write whether you applications are old pseudocode MDL apps (compiled by mcomp.exe) or native C apps compiled by Visual Studio 2005 into dll files. As Jon mentioned, there are plenty of changes in CONNECT Edition, especially: Pseudocode is not supported anymore, so mcomp.exe compiler is not part of MicroStation SDK. MicroStation CONNECT Edition is 64bit application. MDL API (based on C) and MicroStationAPI (C++) were reworked into one single native C++ API with plenty of new features. Some MDL functions are still available (in a form of C++ methods), often with different signatures (because of data types changes), and some were removed. Visual Studo 2015 is required to compile native code app for MicroStation CONNECT Edition Update 5 (VS2013 was required in older CE versions). User interace is different (ribbon is introduced), which often requires modificaiton of existing application to adapt new GUI. If your applications are pseudocode applications, there are (at least) two conversion together required: To change MDL code to native code and to change V8i code to CE code. In my opinion it's better to do these conversions separately, so at first to convert V8i MDL code to V8i native code (which is about to change make file and to change the code in specific places) and then to convert working V8i native code to CE native code. But this approach requires to have also Visual Studio 2005 (maybe VS2008 is enough for basic testing) to be able to compile and test V8i native code application. With MicroStation CONNECT Edition SDK a migration tool is delivered, which helps to change MDL functions call to their new parameters. But it's not fully automatic conversion tool, only a help with repeating task. With regards, Jan
↧
Forum Post: event when user interactively places a reference or raster?
Hi, I am triggering a reference/raster attachment via the CadInputQueue.SendCommand() method, e.g.: m_ustnApp.CadInputQueue.SendCommand("raster attach interactive \"+filePath+"\""); m_ustnApp.CadInputQueue.SendCommand("rf=\"+filePath+"\",,,,"); What I'm looking for is an event notification that the user has INTERACTIVELY placed the reference/raster, or cancelled the operation, but I can't seem to find any such thing. If I use the IAttachmentEvents or IRasterEvents handlers, they notify me when a file is attached or loaded, but not when it is *placed* or cancelled. I have also tried looking for an event that is triggered when the active command changes (e.g. I could watch for "Attach Raster" changing to something else and check for the existence of a new attached raster file) but I can't find anything like that either. Can anyone offer any advice? Thanks.
↧
Forum Post: RE: event when user interactively places a reference or raster?
Hi, [quote user="AB567F69-61A5-41E1-A0D4-3A2FC568DA0F"]If I use the IAttachmentEvents or IRasterEvents handlers, they notify me when a file is attached or loaded, but not when it is *placed* or cancelled.[/quote] It's necessary to distinguish between events processed by MicroStation and what happens "inside a function", because it is not usually known to MicroStation. I guess MicroStation knows when "attach reference" tool is started (because the command is processed by InputQueue and MicroStation state machine) and when it's placed (because a design file is modified and a new element is added), but MicroStation probably does not know details how the reference is placed, because it's an internal workflow of the tool itself. But it's just my guess and should be tested using a proper code. [quote user="AB567F69-61A5-41E1-A0D4-3A2FC568DA0F"]Can anyone offer any advice? [/quote] You did not write what MicroStation do you use (I recommend to read and follow MicroStation Programming Forum best practices ), but in general managed code is not the right tool to monitor MicroStation events. If you need tightly integrate with MicroStation and to monitor internal events, you have to use MDL C API. In my opinon you should start with mdlSystem_setFunction and mdlInput_setFunction, because they allow to monitor wide variety of system events and MicroStation input queue. After you will be able to check a content of input queue and related system events when Attach Reference and Attach Raster tools are used, it should become clearer what types of information are accessible. With regards, Jan
↧
Forum Post: RE: starting a new bentley map session
Hi Alessandro, as far as I remember, it was discussed arelady in the past and I think it's not possible to start an application using Interop Connector including arguments. A workaround is to start Bentley Map with arguments using standard NET API (through shell or using Process.Start method, maybe there are some others) and from PID to get Application instance (remember I saw some examples on Internet). Also MicroStation Detector from Jon Summers may help, but I have no personal experience. With regards, Jan
↧
↧
Forum Post: RE: [CONNECT] Delivering an Application
It seems that the GUID ( {39949BF5-7E21-4A7B-A640-6E7199B7D588} ) hasn't changed with MicroStation CONNECT Update 5 (I use the French Version). Regards. Patrice Poulain
↧
Forum Post: [CONNECT C++] DGN mesh vertex normal is lost
Dear experts, I create a DGN mesh model. However, I can't get the mesh vertex normal by API PolyfaceHeader::Normal(). In result, the converted mesh looks not smooth. My question: Should all mesh data in the MicroStation carry the vertex normal data? Is there any API to generate the vertex normal for the mesh body? In MicroStation, My result(not smooth),
↧
Forum Post: RE: [CONNECT C++] DGN mesh vertex normal is lost
Hi Justin, [quote user="Justin Wang"]I create a DGN mesh model.[/quote] How? Manually, by some code? Can you provide a file with the result? [quote user="Justin Wang"]I can't get the mesh vertex normal by API PolyfaceHeader::Normal().[/quote] What does it mean? Do you receive an error message or returned data are just not correct? [quote user="Justin Wang"]In result, the converted mesh looks not smooth. [/quote] I don't understand how smooth display depends on the mesh normal? (but I am not expert) Mesh is created from facets, so it is never "smooth" When I want to get a smooth mesh, there are two ways: To create so small facets, that they will be not visible in normal display. This option is wrong I think and should not be used. To instruct MicroStation to display the mesh smooth regardless it is not. Tool "Facet Smoothing" is used for this purpose. [quote user="Justin Wang"]Should all mesh data in the MicroStation carry the vertex normal data?[/quote] There are two errors in the question: The normal is not stored, but calculated, because it depends on a facet actual parameters. Only when Facet Smoothing tool is used, the newly calculated normals are stored as attribute linkage data, but this is for display purpose and has no influence to geometry itself. The normals defines facet orientation , so "vertex normal data sounds" seems to be missunderstanding. How a vertex can have normal (how it can be calculated?). But maybe I am wrong at this point... [quote user="Justin Wang"] Is there any API to generate the vertex normal for the mesh body?[/quote] I guess PolyfaceVisitor should be used to obtain data relevant for individual facets. With regards, Jan P.S. In MicroStation CONNECT Edition there is tool Mesh Audit (not sure in what Update it was released), which can help to compare good and bad versions of the mesh.
↧
Forum Post: RE: [CONNECT C++] DGN mesh vertex normal is lost
[quote user="Justin Wang"]I can't get the mesh vertex normal by API PolyfaceHeader::Normal()[/quote] We can't see your code, so we can only guess what might be going wrong. Please post some code that shows us what you are doing.
↧
↧
Forum Post: ElementEnumerator gone??
Is the ElementEnumerator object type no longer available while programming a macro? I am trying to edit all the tags in a file at once and want to parse through each tag indivdually; in the past I used an ElementEnumerator but now I am receiving an error that says "Compilation failed at line 6. (the line I defined the ElementEnumerator) Unknown type." Is there a different way of accessing each tag individually?
↧
Forum Post: RE: ElementEnumerator gone??
Please follow the MicroStation Programming forum best practices . Identify Your Platform Please identify the version of MicroStation, or other product such as PowerDraft, that you are using: MicroStation CONNECT or MicroStation V8 i . What is the 8-digit version number ( e.g. 10.xx.yy.zz) of MicroStation? If you're using MicroStation in a ProjectWise (PW) managed environment, let us know that too. The APIs supplied with MicroStation CONNECT are different to those supplied with MicroStation V8 i . Consequently, our answers are likely to be different. Identify Your Programming Language Are you writing MDL, C++, C#, VB.NET or MicroStation VBA? Code Syntax Highlighting When you post code, use the Forum advanced editor 's syntax highlighting tool. That's availabe from the Tools|Source Code button.
↧
Forum Post: RE: ElementEnumerator gone??
Hi Jon -- I am using MicroStation V8i and created the macro using Microstation BASIC.
↧
Forum Post: RE: ElementEnumerator gone??
Hi, [quote user="8981F6F8-7E53-40CB-A871-69F6CC8A0278"]Is the ElementEnumerator object type no longer available while programming a macro?[/quote] As Jon wrote, it's complicated to help when there is no information about product and version you use. Based on while programmin a macro I guess you use MicroStation VBA, but it's not clear whether V8 i , CONNECT Edition (and what Update version of CE) or other version. But regardless the version, ElementEnumerator is a standard part of MicroStation VBA API and it has not gone. [quote user="8981F6F8-7E53-40CB-A871-69F6CC8A0278"]but now I am receiving an error that says "Compilation failed at line 6[/quote] Please share your code, especially how do you receive the enumerator. [quote user="8981F6F8-7E53-40CB-A871-69F6CC8A0278"]Is there a different way of accessing each tag individually?[/quote] It's not quite clear what do you mean by individually . Do you need to access all tags attached to a particular element? Or by individually you mean e.g. to work with the same tag, attached to elements? With regards, Jan
↧
↧
Forum Post: RE: ElementEnumerator gone??
[quote user="Gretchen"]I am using MicroStation V8i and created the macro using Microstation BASIC[/quote] MicroStation BASIC never had an ElementEnumerator object. You must have been using MicroStation VBA!
↧
Forum Post: RE: ElementEnumerator gone??
[quote user="Gretchen"]I am using MicroStation V8i and created the macro using Microstation BASIC.[/quote] Don't use MicroStation BASIC in MicroStation V8i. MicroStation BASIC was marked as obsolete long time ago and it's recommended to use MicroStation VBA that provides better API and better tools ... and comapring to MicroStation BASIC it's actively developed and maintained. With regards, Jan
↧
Forum Post: RE: [CONNECT C++] Reporting Element Properties
Element properties *are* ECProperties. See for example BaseElementSchema:MstnClosedBoundary, which includes area + perimeter properties. If you are reporting on Item Types and want also to include properties of the element to which the Item is attached, use OnSameElement relationship.
↧