Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all 7260 articles
Browse latest View live

[CONNECT C++] Add Formatting to a Report Column

$
0
0

The SDK example Annotations\ReportsExample shows how to create a report definition programmatically: create a set of ColumnDefinitionNodes...

ColumnDefinitionNodePtr columnNode = groupNode.CreateColumnDefinition (columnName, -1);
ReportColumnAccessorList accessors;
accessors.push_back (ReportColumnAccessor (QualifiedECAccessor (schemaName, className, accessString)));
columnNode->SetAccessors (accessors);

What is not shown, and what I can't find mentioned in MicroStationAPI help, is how to apply formatting to a report column.


RE: [CONNECT C++] How do I stop an EC area formatter appending a unit decorator?

$
0
0
Set ShowLabel property to false, then put whatever suffix you want into Suffix property.
Your code above does not specify the type of your 'decorator' variable, but that property is an int enum accepting either 0 ('Sq. Unit' label format) or 1 ('Unit2' label format).

You may find it helpful to test this stuff out in the Fields Editor.

Regards,
Paul

RE: [CONNECT C++] EC Schema volume decorator

$
0
0
<ECClass typeName="Vol" isDomainClass="True">

RE: [CONNECT C++] EC Schema volume decorator

RE: [CONNECT C++] TextBlock::FindTextW and TextBlock::ReplaceTextW

$
0
0

OK - I just stopped using "precompiled headers" and things went a little further. Now I get a message about DLLMain already defined in MSVCRT.

 

1>mfcs120u.lib(dllmodul.obj) : error LNK2005: DllMain already defined in MSVCRT.lib(dllmain.obj)
1>C:\Program Files\Bentley\MicroStation CONNECT Edition\MicroStation\mdlapps_development/srs_incrementText.dll : fatal error LNK1169: one or more multiply defined symbols found

 

Time for some Google-ing...

 

Bruce

RE: [CONNECT C++] TextBlock::FindTextW and TextBlock::ReplaceTextW

$
0
0

Well, found an answer that involved adding the two referenced .lib files to the "Additional Dependencies" of the Linker section. Still don't understand why only those two functions caused the "function not found" error, but at least I'm moving forward...

RE: [CONNECT C++] EC Schema volume decorator

$
0
0

[quote user="Paul Connelly"]You missed the "Vol" class[/quote]

Ha!  I'm used to seeing all names in full, so that abbreviation threw me 8-(

[CONNECT C++] EC Schema volume decorator

$
0
0

The Mstn Property Format schema provides data used to format area quantities (e.g. 27.23 Acres).  However, I can't find any similar schema data that would be used to format volumes (e.g. 43.138 Cu. m or 31.87 m³).  What have I missed?


RE: [CONNECT C++] TextBlock::FindTextW and TextBlock::ReplaceTextW

$
0
0

Bruce,

LNKxxxx errors are often (though not always) the result of missing libraries or public exports using a correct calling convention.  Although you use and call functions defined in Header files possibly requiring an additional Namespace (both used for the compiling), the linker (used to link/merge binary library objects) needs to know what specific libraries are required to fault in required binary code for those functions (Project: Linker > Additional Dependencies).

In both functions used above, both have binary objects located in: library\DgnPlatform.lib; which should be included in most of your "template" Visual Studio projects going forward.  The MDL C API help in most cases should provide a "Required Library" remark indicating which library is required to link with.  For the MDL C++ API in most cases you can use the method's namespace or direct export type as the hint for which library to link: e.g. DGNPLATFORM_EXPORT ReplaceText implies to link a DgnPlatform lib.

As a side-note, the upcoming MicroStation CONNECT Edition Update 5 SDK will be including a new SDKSearch script that should help make identifying Local and Remote(forum) based resources (references, code, conversations, etc.) for both new development and migrations much a easier task to perform.

HTH,
Bob

RE: [CONNECT C++] How do I stop an EC area formatter appending a unit decorator?

$
0
0

[quote user="Paul Connelly"]Set ShowLabel property to false, then put whatever suffix you want into Suffix property[/quote]

Those are properties of what class?  I can't find them in help or any header file?

RE: [CONNECT C++] How do I stop an EC area formatter appending a unit decorator?

$
0
0
MstnPropertyFormatter schema.

<ECClass typeName="AreaClass" isDomainClass="True">
<!--...snip...-->
<ECProperty propertyName="SX" typeName="string" displayLabel="Suffix">

RE: [CONNECT C++] TextBlock::FindTextW and TextBlock::ReplaceTextW

$
0
0

[quote user="Bruce Reeves SRNS"]What am I doing "wrong" such that the linker can't find the functions, which are clearly there?[/quote]

Keep in mind that bmake and Viz Studio are front-ends.  They use the same back-end compiler and linker.

You must make Viz Studio aware of whatever library files you have listed in your bmake file.  Viz Studio Project Properties is the place to that, in the Linker section.

RE: Get Coordinate

$
0
0

ShowCursorPos works but it makes zooming by mouse wheel unresponsive

Only adding sleep function I am able to make it more responsive. Is there a better way?

#If VBA7 Then
Private Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal lngMilliSeconds As Long)
#Else
Private Declare Sub Sleep Lib "kernel32" (ByVal lngMilliSeconds As Long)
#End If

Sub ShowCursorPos()
    Do While True
    Sleep 100
       ShowPrompt CursorInformation.CurrentPointRaw.X & ", " & CursorInformation.CurrentPointRaw.Y

  DoEvents
    Loop
End Sub


 

RE: Get Coordinate

$
0
0
Hi Oto,

you returned to quite old discussion. It would be helpful to mention what MicroStation version do you use (V8i, CE?) and also what do you want to achieve. VBA is a synonymum for slowness and inefficiency, so it's recommended to use different tools (native code) to work with highly dynamic events like view or cursor updates.

With regards,

Jan

RE: [CONNECT C++] TextBlock::FindTextW and TextBlock::ReplaceTextW

$
0
0

What is "unclear" to me is that I have each .lib listed in the .mke file as a linker "Dependency".  It's only when I additionally listed "mfcs120u.lib" and "msvcrt.lib" as Dependencies did the code link. Up until this point, I have never had a need to include those two files as "Additional Dependencies" - the linker was happy (until I tried to use those two TextBlock functions)....

 

Bruce


[CONNECT C++] TextBlock::FindTextW and TextBlock::ReplaceTextW

$
0
0

I want a tool similar to the CONNECT example "incrementTextTool". When I use the provided BMAKE to generate the .ma/.dll, all is fine. However, my typical mode is to build the .dll from inside VS2013. When I put the example .cpp file into a VS2013 project, it compiles fine, but the linker chokes on the above mentioned functions. Here is the output:

1>     Creating library C:\Program Files\Bentley\MicroStation CONNECT Edition\MicroStation\mdlapps_development/srs_incrementText.lib and object C:\Program Files\Bentley\MicroStation CONNECT Edition\MicroStation\mdlapps_development/srs_incrementText.exp
1>incrementText.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class Bentley::RefCountedPtr<struct Bentley::DgnPlatform::TextBlock::FindTextMatch> __cdecl Bentley::DgnPlatform::TextBlock::FindTextW(wchar_t const *,struct Bentley::DgnPlatform::TextBlock::FindTextParameters const *,struct Bentley::DgnPlatform::Caret const *,struct Bentley::DgnPlatform::Caret const *)const " (__imp_?FindTextW@TextBlock@DgnPlatform@Bentley@@QEBA?AV?$RefCountedPtr@UFindTextMatch@TextBlock@DgnPlatform@Bentley@@@3@PEB_WPEBUFindTextParameters@123@PEBUCaret@23@2@Z)
1>incrementText.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __cdecl Bentley::DgnPlatform::TextBlock::ReplaceTextW(wchar_t const *,struct Bentley::DgnPlatform::Caret const &,struct Bentley::DgnPlatform::Caret &)" (__imp_?ReplaceTextW@TextBlock@DgnPlatform@Bentley@@QEAAXPEB_WAEBUCaret@23@AEAU423@@Z)
1>C:\Program Files\Bentley\MicroStation CONNECT Edition\MicroStation\mdlapps_development/srs_incrementText.dll : fatal error LNK1120: 2 unresolved externals

 

 

What am I doing "wrong" such that the linker can't find the functions, which are clearly there? Is there a "name mangling" issue that I'm not seeing?

 

 

Bruce

RE: Get Coordinate

$
0
0

[quote user="Oto"]Only adding sleep function I am able to make it more responsive. Is there a better way?[/quote]

How about VBA's DoEvents method?

Get Coordinate

$
0
0

Hi Everybody

I am gonig to start a Mvba Program and i need to get the coordinate(X,Y,Z) when i am moving mouse without sending any data point. if i can find any function in microstation vba?

RE: [V8i VBA] Detecting if coordinate is above or below target element

$
0
0

Just getting back to this, hectic week so far

[quote user="Jon Summers"]

However, if the thought of vector algebra and computational geometry seems too daunting, then it's time to hire a consultant.[/quote]

I wouldn't say daunting as I recall delving into vectors a bit last year and have been testing the theory out.

[quote user="Jon Summers"]

One way to find if a point is 'left' or 'right' of a line is to use vector algebra.  Construct one vector V1 from the chainage element's direction at the point of intersection.  Construct a second vector V2 which is the perpendicular from the point onto the chainage line.  Calculate the cross product of the two vectors V3 = V1 x V2.

With the result of that calculation, you can discover all kinds of stuff. [/quote]

Can you clarify the statement highlighted in bold or provide a graphic showing the 2 vectors to calculate (I think I know what you mean but I want to be 100% sure)?

I originally thought you were suggesting construct 1 vector from the coordinate to the perpendicular intersection with the chainage element and another from the perpendicular interstection point on the chainage element back to the coordinate. This would yield parallel vectors and a cross product of 0 as my tests have confirmed hence why I have had to reread your suggestion.

If I was guessing I would guess you meant the start of the vector is the perpendicular intersection with the chainage element & coordinate and the direction is at a tangent to this point (which is 90 degrees to the other vector) but this could be 1 of 2 possible directions so I presume we apply the right-hand rule?

RE: [V8i VBA] Detecting if coordinate is above or below target element

$
0
0

[quote user="Barry Lothian"]I originally thought you were suggesting construct 1 vector from the coordinate to the perpendicular intersection with the chainage element[/quote]

That's one vector.  The other vector is the tangent of the chainage element at the same point of intersection.

[quote user="Barry Lothian"]This could be 1 of 2 possible directions[/quote]

That's what the cross product help you to resolve.  It's another vector, that will be pointing up or down (i.e. positive or negative Z value).

Viewing all 7260 articles
Browse latest View live


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