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

how to cast IECInstancePtr to DgnElementECInstancePtr

$
0
0

I want use DgnElementECInstance's following API which gives me user friendly property value, 

spElementECInstance->GetValueAsString(value, index, false, 0);

however when the ECValue is struct type, I can only get the IECInstancePtr type which don't have GetValueAsString, any suggestions how to get user friendly property value for a IECInstancePtr?

Thanks

Danny


Creating a VBA Macro to move Drawings to 0,0

$
0
0

I am trying to create a Macro that I can run in the batch processor to move the bottom left corner of my drawings to the point 0,0. The problem is that these drawings are all located at different locations in model space. I tried just a simple CHOOSE ALL, MOVE, KEY-IN XY=0,0 macro, but because the drawings are all scattered around, it doesn't work correctly. Does anyone have a solution to this problem?

Creating a VBA Macro to move Drawings to 0,0

$
0
0

I am trying to create a Macro that I can run in the batch processor to move the bottom left corner of my drawings to the point 0,0. The problem is that these drawings are all located at different locations in model space. I tried just a simple CHOOSE ALL, MOVE, KEY-IN XY=0,0 macro, but because the drawings are all scattered around, it doesn't work correctly. Does anyone have a solution to this problem?

[V8i SS2 VBA] Listbox headings

$
0
0

Hello All,

How does one set the text for the headings in a multi column listbox?  I do use .AddItem to place things in the listbox if that makes a difference.

Thanks,

Minion

MS CE - How do I link DDD to a VBA

$
0
0

I want to know how to link a DDD cell to a VBA so the user can use the VBA form to populate the DDD?

Ian 

[Connect C++] How to read all linkages and XAttributes contents

$
0
0

Hi Experts,

I have a model and one of the element contains 14 linkages and 1 xAttributes but don't know how to read them all out.

I read out all engineer content associated with this element, and also use following codes to read all xmlFragment properties, seems there still missing some property.

 

        XmlFragmentListPtr linkageFragments = XmlFragmentList::ExtractFromElement(eh);
        if (linkageFragments.IsValid())
        {
            for each (XmlFragmentPtr fragment in (*linkageFragments))
            {
                if (fragment.IsValid())
                ...
            }
        }

When opening this model in the AECOsim Building Designer I saw some properties were not be read out, but I don't know if they are the 14 linkages and also don't know how can I read them out with API.

[CONNECT C++] how get the extended element by C++ native API

$
0
0

Hi experts,

I am using DGNPlatform Native C++ version(v5.3.2.56) toolkit independent of MicroStation.

For the extended element type 106, I want to know how get the geometry data for the extended element from the toolkit. Currently, I use the following API to drop the extended element to get the geometry data. Do you think that it makes sense?

DisplayHandler::Drop(ElementHandleCR eh, ElementAgendaR dropGeom, DropGeometryCR geometry)

Justin

[CONNECT C++] how get the feature solid by C++ native API

$
0
0

Hi experts,

I am using DGNPlatform Native C++ version(v5.3.2.56) toolkit independent of MicroStation.

The following API can get valid IBRepQuery for the smart solid. But it failed for the feature solid. For the feature solid, should I use which API to query the geometry data?

IBRepQuery* pBrep = dynamic_cast<IBRepQuery*>(&elmHandler)

Justin


[CONNECT, C++] Anyone had any luck using the ribbon with Named Expressions in Connect?

$
0
0

Hi folks,

I'm trying to use the new ribbon interface to replace my old V8i toolbox in my app. Under V8i I would disable or enable individual icons in the toolbox via calls to mdlDialog_item*() functions. Since I can't control what gets displayed/disabled in the ribbon via direct calls to the SDK, I've been trying to use named expressions hooked into the dialog access strings published as CExpressions, which are then delivered in a DGNLIB file.

For example, if my app is called "MyAppName" and it has a global variable published with the name "MyBooleanVariable", then I can add a named expression "MyNamedExpression" with the expression set to: "Session.EvalCExprAsBool("MyBooleanVariable","MyAppName")", and this seems to work correctly if MyAppName.MA is loaded and the boolean variable "MyBooleanVariable" is published via a call to mdlDialog_publishBasicVariable().

This has caused me to ponder the following questions:

  1. How do I define my own Symbol Sets that appear in the Named Expression Editor dialog? Can this be done at runtime of MyAppName, or does it have to be predefined in a DGNLIB?
  2. Is it possible to make the symbol sets published via the mdlCExpression_ functions in my app appear in the Named Expressions dialog? If so, how? If not, why do Symbol Sets differ between C++ MA's and C# Add-ins?
  3. I have successfully added a named expression that "tests" correctly in the named expression dialog, and saves to the DGNLIB, but it doesn't appear as a selection from the Customize Ribbon dialog for "Visibility" nor "EnableExpression" unless the DGNLIB is defined in MS_DGNLIBLIST. Similarly, my custom ribbon does not appear in the Ribbon Editor unless it appears in MS_GUIDGNLIBLIST. This forces me to deliver both the ribbon and the Named Expressions the ribbon depends on in separate DGNLIBs. Why does this limitation exist and why isn't it documented? (I wasted hours trying to figure this out).
  4. Why does MicroStation crash whenever I click on the "..." button to choose an Icon when editing the keywords in the Named Expressions dialog? This happens 100% of the time for me in Connect Edition Update 4.
  5. How are 3rd party apps expected to deliver the interface to customers? It seems we can no longer just provide MAs/DLLs, we now need DGNLIBs and config files that add the DGNLIBs to existing search paths. This seems fraught with potential problems if a custom config file overwrites the DGNLIB search path.

A working example of a custom ribbon would have been really useful in the Connect SDK, but if anyone known any answers here it would also be very helpful.

[CONNECT C++] The point index of the mesh is the negative value

$
0
0

Dear experts,

The mesh point index from the toolkit API is the negative number. As a workaround, I use its corresponding positive number. Especially, after calling PolyfaceHeader::Triangulate(), the negative number of the mesh point index always appears as follows.

My qusetion: what does the negative point index of the mesh mean?

[CONNECT C++] The API change in the new toolkit

$
0
0

Dear experts,

I am using 10.00.00.28 MicroStation release. I found that the following API is removed in the toolkit API corresponding to 10.00.00.28 MicroStation release. This API is ever used to get the smart solid body data in the previous toolkit. So, what is the new API to get the smart solid in the toolkit API corresponding to 10.00.00.28 MicroStation release?

SolidsKernelAdmin::_RestoreEntityFromMemory (ISolidKernelEntityPtr& out, void const* pBuffer, UInt32 bufferSize, ISolidKernelEntity::SolidKernelType kernelType, TransformCR transform)

[CONNECT C++] Change Font of a Run

$
0
0

Is there any way to change the font of a run in a TextBlock? The only way I can see is to "Remove()" the Run's text, and "Insert()" it back after setting a new RunProperties (TextBlock::SetRunPropertiesFroAdd() ). I can get a "const" pointer/reference to the current TextBlock's "Run" , so I can't see a way to just assign a new font DgnFont...

I should clarify that I have a "mixed" font TextBlock, and I only want to change certain "Runs" to a different font. I think using ElementPropertiesSetter changes the entire TextBlock, and that is not what I wish to do....

Bruce

The 2017 Top Programming Languages

[CONNECT C++] The closed curve is recognized as curve or surface?

$
0
0

Hi

If I create a closed curve in Mirostation V8i, and see it in "Smooth" display, the area of the curve will be filled. The picture below shows the closed curve in the display style of "Wireframe" and "Smooth".

In the code, the element is recognized as curve, and will do not go to the code of handling surface.

     CurveVectorPtr pathCurve = ICurvePathQuery::ElementToCurveVector (eh);
     if (pathCurve.IsValid ())

So my question is that why the closed curve will be filled? For the closed curve, shall I considered it as a curve or a surface? If it is surface, how to get it from toolkit?

Upgrading V8i MDL Apps to Connect

$
0
0

Is there any documentation on the absolute basic essentials to implement when porting from V8i mdl's to Connect?.  I have written a few mdls in the past and want to now re-compile them for Connect.  I have no idea where to start, and am not familiar with Windows programming.  I previously made use of Select Series III SDK - I am lost in unfamiliar territory.  I am hoping there is a fairly easy way out!


[CONNECT C++] Reporting Element Properties

$
0
0

The SDK example ReportsExample shows us how to specify Item Types to be used in a report.

How do we add element properties to a report definition?  For example, if my schema should be attached only to closed planar elements, how do I add element metrics such as area and perimeter to my report definition?

It looks like I should call ColumnDefinitionNode::SetAccessors, but ReportColumnAccessor seems to apply only to ECProperties and not element properties.

[CONNECT C++] DGN mesh model face loop orientation

$
0
0

I create a simple cube mesh in the MicroStation. By the toolkit API, I found that the face normal is outwards(right-handed). The mesh face loop orientation is counterclockwise. Is that always true for all dgn mesh models?

[CONNECT C++] DGN mesh vertex normal is lost

$
0
0

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),

ElementEnumerator gone??

$
0
0

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?

MicroStation.r.h

$
0
0

Hi,

I'm trying to manually convert an add-in that worked in MicroStation v8i so that it works in MicroStation CONNECT Edition. So far I managed to do a couple things that work and I fixed a few errors too. However, I can't figure out why when I include MicroStation.r.h all of a sudden I get tons of errors from that file. I use Bmake to compile outside of visual studio. Here's some of the errors: 

C:\Program Files\Bentley\MicroStationCONNECTSDK\include\Mstn\MicroStation.r.h(11) : error: can't open #include file DgnPlatform\DgnPlatform.r.h

C:\Program Files\Bentley\MicroStationCONNECTSDK\include\Mstn\MicroStation.r.h(11) : error: No such file or directory

C:\Program Files\Bentley\MicroStationCONNECTSDK\include\Mstn\MicroStation.r.h(12) : error:  can't open #include file DgnView\DgnViewSettings.r.h

C:\Program Files\Bentley\MicroStationCONNECTSDK\include\Mstn\MicroStation.r.h(12) : error: No such file or directory

(etc, same errors for DgnPlatform\Image.h and Mstn\MdlApri\rtypes.r.h)

C:\Program Files\Bentley\MicroStationCONNECTSDK\include\Mstn\MicroStation.r.h(43) : error: 'typedef' : syntax not recognized

I use the MicroStation CONNECT Developer Shell and the environment variables seem to be instantiated correctly.

Viewing all 4331 articles
Browse latest View live


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