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

Forum Post: RE: I am trying to place 3 lines of MORSE CODE at an angle using VBA.

$
0
0
[quote userid="85815" url="~/products/programming/microstation_programming/f/microstation-programming---forum/177550/i-am-trying-to-place-3-lines-of-morse-code-at-an-angle-using-vba/514572"] Set oCadInputMsg = CadInputQueue.GetInput[/quote] That style of coding is reminiscent of MicroStation BASIC. Prefer to write a class, using MicroStation VBA, that Implements IPrimitiveCommandEvents . There are examples in MicroStation VBA help and here . [quote userid="85815" url="~/products/programming/microstation_programming/f/microstation-programming---forum/177550/i-am-trying-to-place-3-lines-of-morse-code-at-an-angle-using-vba"]The lines of text need to be rotated by selecting a line[/quote] Write a class that Implements ILocateCommandEvents . Let user pick a line, calculate its rotation and pass it to your text creator class that Implements IPrimitiveCommandEvents . That way, your commands will automatically behave like MicroStation built-in primitive commands and you eliminate the tortuous procedural logic you have shown above.

Forum Post: RE: I am trying to place 3 lines of MORSE CODE at an angle using VBA.

$
0
0
I am using the class Implements ILocateCommandEvents to locate the line and get its rotation. Using the Implements IPrimitiveCommandEvents I don't think will help. The code I am using to place the text will be the same in the class. I can create the text, rotate it and place it above the line with the code I have. The problem is the left edges are not aligned when it is place. I added the Group code to see if I could put my text in the Group and rotate the Group as 1 object. Everything works but I can't get the Group to place the text. It has the 3 text elements in the group it just won't display in the design file.

Forum Post: RE: I am trying to place 3 lines of MORSE CODE at an angle using VBA.

$
0
0
[quote userid="85815" url="~/products/programming/microstation_programming/f/microstation-programming---forum/177550/i-am-trying-to-place-3-lines-of-morse-code-at-an-angle-using-vba/514588"]I can't get the Group to place the text[/quote] A Named Group is a logical collection of elements. It doesn't have any geometric capability. Prefer to create a normal cell element, using your text elements as its components. You can rotate a cell easily: it has an origin and a rotation.

Forum Post: RE: [CONNECT C#] switch activedgnfile

$
0
0
Hi John, just on the documentations, without testing, I guess you should use to GetModelIndexCollection to obtain list of all models in active design file, iterate the collection to find a proper ModelId and after it to call LoadRootModelById. But it's just thought, even when I merge information from NET and C++ helps, it's not very clear how typical open file and open model scenarios should be implemented properly. Regards, Jan

Forum Post: RE: I am trying to place 3 lines of MORSE CODE at an angle using VBA.

$
0
0
[quote userid="85815" url="~/products/programming/microstation_programming/f/microstation-programming---forum/177550/i-am-trying-to-place-3-lines-of-morse-code-at-an-angle-using-vba/514566"]Try it yourself.[/quote] Hahaha, are you serious? What about to provide example like dgn file and also the used font, because "morse code", number 82, is for sure not included in standard MicroStation installation. I hope you do not expect anybody will search Internet what MicroStation 82 can be and where it can be downloaded from. With regards, Jan

Forum Post: RE: [CONNECT C#] switch activedgnfile

$
0
0
Hi John Drsek , Although Jan provides and assumes correctly some of the underlying C++ API paths required, the .NET API to Activate and Display is not completely available at this time. Artur Goldsweer provided two work-arounds to accomplish this task until Enhancement 432451 is addressed. We will check up to see if we can move this request along with a higher priority. Until then, please use the recommendations here: [CE5 NET API C#] How to active existing Model Thank you, Bob

Forum Post: RE: [CONNECT C++] File HelloWorld.ma does not contain MDL application HELLOWORLD

$
0
0
[quote userid="5932" url="~/products/programming/microstation_programming/f/microstation-programming---forum/177578/connect-c-file-helloworld-ma-does-not-contain-mdl-application-helloworld/514672"]HelloWorld is not actual app name but I could try any of delivered examples.[/quote] Yes, if the problem appears during the compilation, probably any delivered example can be used as a test. Just navigate to any example (e.g. \Elements\AccuDrawDemo\ ?) and type build verbose. If your SDK shell is configured correctly, everything should run automatically. Regards, Jan

Forum Post: RE: [CONNECT C++] File HelloWorld.ma does not contain MDL application HELLOWORLD

$
0
0
Delivered examples compile correctly.

Forum Post: RE: [CONNECT C++] File HelloWorld.ma does not contain MDL application HELLOWORLD

$
0
0
It's important finding ;-) So now it's about to find where your build recipe (mke file) is different from the example one. My guess it's maybe about linked libraries Regards, Jan

Forum Post: RE: [CONNECT C++] File HelloWorld.ma does not contain MDL application HELLOWORLD

$
0
0
Seems to be more related to local character set. Noticed that only difference between ma files is around text strings. Changed system locale to Latvian and after restart most of previous project compile except the latest one. OS:Windows 7 64-bit English

Forum Post: scan GroupedHoleElement

$
0
0
I would like ask if it is any way in .Net environment to scan GroupedHoleElement (expect for using interop lib). I tried use (var curveGroup = e.GetCurveVector();) and it exposes components foreach(var curve in curveGroup) { CurvePrimitive x = curve; } But I didn’t found any u seful way how to manipulate curveprimitives (if it is shape, circle or …) how to obtain geometry, stroke, level, fill parameters.

Forum Post: RE: [CONNECT C++] File HelloWorld.ma does not contain MDL application HELLOWORLD

$
0
0
Removing this from resource file did the trick: DllMdlApp DLLAPP_Helloworld = { L"Helloworld", L"Helloworld" // taskid, dllName }

Forum Post: RE: scan GroupedHoleElement

$
0
0
Hi Miro, it seems I have to write it for every posted question in this discussion group :-( ... please follow best practices and to specify exactly what product and version do you use. This forum is not solely for MicroStation developers and also there have been 13 different versions of MicroStation released so far, which means 13 different versions of NET API. [quote userid="225149" url="~/products/programming/microstation_programming/f/microstation-programming---forum/177583/scan-groupedholeelement"]But I didn’t found any useful way how to manipulate curveprimitives (if it is shape, circle or …) [/quote] I recall it was discussed several times already, did you try to search the forum? I remember (but not very well) it was about GetChildren (which I think did not work because of not finished implementation at this time) or to use ElementGraphicsProcessor. The right solution depends not only whether API is working, but also what you need to do with the elements. [quote userid="225149" url="~/products/programming/microstation_programming/f/microstation-programming---forum/177583/scan-groupedholeelement"]how to obtain geometry, stroke, level, fill parameters.[/quote] I am not able to find the discussion, but I guess CE behaves differently from V8i and the rule now is that all grouped elements have the same symbology. So I guess it's enough to use .Get methods (for properties like FillColor) or try to use ElementPropertiesGetter. I am not sure about geometry, but GetChildren or ElementGraphicsProcessor should work. With regards, Jan

Forum Post: [CE SDK U12] Define ntLib in winntmdl.mki Line 543ff causes fatal error LNK1181

$
0
0
Hello, I have "NTTOOLS=C:\PROGRA~2\MIB055~1\2017\PROFES~1\VC\Tools\MSVC\1416~1.27 0\ " with trailing slash. But the '{}' will cut the last '\' and I got Link error "fatal error LNK1181: Eingabedatei "C:\PROGRA~2\MIB055~1\2017\PROFES~1\VC\Tools\MSVC\141 6~1.270lib\x 64\msvcrt.lib"" %if defined (BUILD_USING_VS2017) %if $(TARGET_PROCESSOR_ARCHITECTURE)=="x86" ntLib = ${ntTools}lib/x86/ AsmCmd = ${nttools}bin\HostX86\x86\ml %else ntLib = ${ntTools}lib/x64/ %endif %else ntLib = ${ntTools}lib${slashAmd64}/ %endif After "correcting" the winntmdl.mki with missing '/' everything seems to be ok. %if defined (BUILD_USING_VS2017) %if $(TARGET_PROCESSOR_ARCHITECTURE)=="x86" ntLib = ${ntTools} / lib/x86/ AsmCmd = ${nttools} / bin\HostX86\x86\ml %else ntLib = ${ntTools} / lib/x64/ %endif %else ntLib = ${ntTools} / lib${slashAmd64}/ %endif Is this the right way to correct this, or did I miss something? Thanks a Lot Volker

Forum Post: RE: scan GroupedHoleElement

$
0
0
[quote userid="225149" url="~/products/programming/microstation_programming/f/microstation-programming---forum/177583/scan-groupedholeelement"]I would like ask if it is any way in .Net environment to scan GroupedHoleElement[/quote] In addition to Jan's comments, you should note that a Grouped Hole is an anonymous cell. That is, to find grouped holes you should search for anonymous cells. Then, test the cell to determine if it is really a grouped hole.

Forum Post: RE: [CONNECT C++] File HelloWorld.ma does not contain MDL application HELLOWORLD

$
0
0
[quote userid="5932" url="~/products/programming/microstation_programming/f/microstation-programming---forum/177578/connect-c-file-helloworld-ma-does-not-contain-mdl-application-helloworld/514690"]Removing this from resource file did the trick[/quote] Is DllMdlApp defined in another resource file? If so, then presumably you previously had a duplicate resource warning? If not, then I don't understand how your app. can work. The DllMdlApp resource tells MicroStation what to do when you key-in mdl load HelloWorld . It reads the .ma file that contains that resource, and when it finds DllMdlApp it loads the named DLL. Without that information, MicroStation doesn't know that it should load your HelloWorld DLL into memory.

Forum Post: RE: [CONNECT C++] File HelloWorld.ma does not contain MDL application HELLOWORLD

$
0
0
Not sure where it is defined but also for other projects the DllMdlApp is not defined in resources. It seems to link automatically at compile.

Forum Post: RE: [CONNECT C++] File HelloWorld.ma does not contain MDL application HELLOWORLD

$
0
0
Hi Oto, [quote userid="5932" url="~/products/programming/microstation_programming/f/microstation-programming---forum/177578/connect-c-file-helloworld-ma-does-not-contain-mdl-application-helloworld/514733"]Not sure where it is defined but also for other projects the DllMdlApp is not defined in resources. It seems to link automatically at compile.[/quote] It's quite interesting finding, because DllMdlApp has been always presented as mandatory part of MDL application. But maybe when there is one dll and everything is named in the same way, it works even without DllMdlApp definition. Maybe Robert Hook can provide some insight? [quote userid="5932" url="~/products/programming/microstation_programming/f/microstation-programming---forum/177578/connect-c-file-helloworld-ma-does-not-contain-mdl-application-helloworld/514690"]Removing this from resource file did the trick:[/quote] But it's not the solution, only workaround. It's nothing wrong with DllMdlApp definition, it's standard MDL applications construction and is used also by all native code MicroStation SDK examples (which work fine as you wrote). Maybe there is a problem with the .r encoding? I am not sure whether rcom is UTF8 aware... but DllMdlApp use wchar_t, so it should be ;-) With regards, Jan

Forum Post: RE: [CONNECT C++] File HelloWorld.ma does not contain MDL application HELLOWORLD

$
0
0
Will try to create simple example to test.

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

$
0
0
When I use Element Information (or Analyze Element), I can see each component of a cell highlighted as I select each component. I can't figure out how to do this reliably programmatically. In MicroStation 2004 I could use mdlElmdscr_display() with the component and it worked nicely. In MicroStation XM through to Connect, I get the elementRef of the component and use mdlLocate_hiliteElement(). However much of the time this doesn't work. It either doesn't highlight at all, highlights the whole cell, or it highlights the component and then partially other components as well. It seems it isn't a reliable method to show just the one component. I've tried using the old MS2004 way, as well as mdlElement_display() and a couple of other methods. I've also messed around with Transient Elements, but this seems to cause its own problems. What is the correct way to handle this simple task? It seems like complex components aren't supported properly by the mdlLocate_hiliteElement() function. Cheers.
Viewing all 25671 articles
Browse latest View live


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