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

Select all element on a level

$
0
0

Good afternoon,

i'm looking to create a VBA that allows you to search for a field in the Element information (e.g. description or text string) and select the elements that have the desired results in view one..

Not sure if this can be done but if anyone knows how i can do this i would appreciate the help? 

Thanks 


[VBA] Select all beam elemnts and change color.

$
0
0

Hello, could you give an example of how to Select all beam elemnts in level and change color. VBA..

Thank you.

use AECOsim Building Designer V8i (SELECTseries 5) 

[V8i VBA/MDL] Is it possible to use mdlStringList_getMember with VBA?

$
0
0

I'm attempting to enumerate an MDL StringList obtained using mdlLineStyle_nameGetStringList from VBA.  As far as I can tell,I've successfully obtained a StringList, but am stuck on how to use mdlStringList_getMember with VBA.

Here's the MDL function prototype in C...

long               mdlStringList_getMember  
( 
char**             ppString , 
long**             ppInfoFields , 
StringList const*  pStringList , 
long               memberIndex  
); 

Which I've translated to this function declaration in VBA...

Declare Function mdlStringList_getMember Lib "stdmdlbltin.dll" ( _
        ByRef pString As Long, _
        ByRef pInfo As Long, _
        ByVal list As Long, _
        ByVal n As Long) As Long 

The problem lies in the first parameter, which in MDL is the address of a char pointer.  As you know, VBA doesn't do pointers, so I've passed ByRef a VBA Long.  That is, the VBA variable now contains the address of a C-style string.  The MDL function is not filling a text buffer, but passing a the address of a text buffer stored in the StringList.

What I can't find is a way to tell VBA to read the C string into a VBA String variable.  Does anyone have any ideas on how to make an MDL StringList readable in VBA?

[CONNECT C#] Create text with active text style

$
0
0

I am trying to create a text using the new .net API, but I cannot find out how to apply the active text style. 

What I have tried is to get active text style and create a TextBlock like this:

            DgnTextStyle style = DgnTextStyle.GetSettings(Bentley.MstnPlatformNET.Session.Instance.GetActiveDgnFile());
            style.SetProperty(TextStyleProperty.Justification, (uint)TextElementJustification.CenterBaseline);
            TextBlock tb = new TextBlock(style, Bentley.MstnPlatformNET.Session.Instance.GetActiveDgnModel());

I have also tried to apply the text style using TextBlockProperties:

            TextBlockProperties tbp = new TextBlockProperties(Bentley.MstnPlatformNET.Session.Instance.GetActiveDgnModel());
            tbp.ApplyTextStyle(style, 1, true);
            tb.SetProperties(tbp);

But with both methods the active text style is not used. Font is always ENGENEERING and text size is always 0.5.

I suspect that the method I use to get active text style is not correct. Any help is appreciated.

regards
Frode Tørresdal

[CONNECT C++] Is there a free tool to convert a graphics file to MDL resource file format

$
0
0

Hi,

Is there a free tool to convert a graphics file to MDL resource file format?

Thanks,

[CONNECT C++] convert the (icon) .rsc to .r

$
0
0

Hi,

I did some search on this forum. I found Jon mentioned "convert the .rsc to .r". But he did not say how

I created an icon RSC file. I need this icon to embedded in the *.r file. Which tool I can use to generate binary data for *.r file. 

Thanks,

How to create custom tools in microstation?

$
0
0

Dear all,

               I am using v8 2004 Edition, i create a new tool in Customize window and save the tool its showing following error.

"Unable to create or open C:\Program Files\Bentley\Workspace\interfaces\MicroStation\default\ustn.m32 with write access.  Operation halted"  

How to clear the Error.

Thanks advance.

Regards,

Karthik M

Here i attached the image

Software Quality Tsar?

$
0
0

Who is responsible for software quality at Bentley?


Macro MVBA

$
0
0

Hi,

I need to learn how to built / create macro MVBA in Micro Station.

Any one can share the reference source or guidance for me, please.

Thanks 

 

Develop C# code(Visual Studio 2013) for Microstation

$
0
0

Hello friends,

I am Saravana Kumar. I am new to microstation V8i application. Already colleagues developed application using  C code for microstation.

Now I have to migrate from C code to C#(visual studio 2013) for microstation.

I dont have any idea about this please send me some examples to develop application using C#(Visual studio 2013) code for microstation

and how to compile and link with microsation V8i.

Regards,

Saravana Kumar

[CONNECT C++] drawing pasted to uM, after mouse click, all drawing will be gone.

$
0
0

Hi,

I have successfully read in all drawing. When I move my mouse, I can see all my drawing moving with my mouse, But when I click my mouse, all drawing are gone.

After debug, I found out that if I don't call function

------------

mdlState_startDefaultCommand();

------------

All drawing will stay (moving with mouse). But I can not drop them into design file.

Anything wrong? Could you give me some hints.


Best,

Display attributes linkage

$
0
0

Display attributes for elements are stored in the dgn a linkage with ID 65 (0x0041). For example attribute ID 8(0x0008) is for element fill and ID 16 (0x0008) is for DisplayStyle.

I see that for some of elements there is also attribute 5 (0x0005) set but can't get for what it is used for and what tool set it?

[CONNECT VBA] IPrintEvents mvba

$
0
0

Is there a runnable example of macro with IPrintevents object and events?

Run Code each time when Save Command is triggered

$
0
0

Is there any chance to run some VBA code each time when a save command is executed?


I know about the SaveAs-Event - but this is not what I need because I would like to run my code each time when the design file is saved and not only when a SaveAs-Command is executed.


The environment I am talking about is Microstation V8i SELECTseries 3 - Version 08.11.09.459

{CONNECT C++} Text

$
0
0

Hi,

I have asked one similar question. But I did not get text displayed.

For V8i, I used following code:

-----------------------
        mdlText_create(pElement, NULL, WTxtString, &Point, &Matrix, &TextSize, &TextFontInfo, NULL);
-----------------------

V8i can display text without any problem.

For CONNECT, I use following code:

--------------------

        DPoint2d fontSize;

        fontSize.x = TextSize.size.width;
        fontSize.y = TextSize.size.height;

        TextElementJustification alignment = TextFontInfo.just;
        EditElementHandle textElm( pElement, ISessionMgr::GetActiveDgnModelP());
    
        //GetTextBlock(textElm, Point, Matrix, WTxtString, (UInt32)Color, font_Width, font_Height, alignment, WFont);

        DgnModelP model = ISessionMgr::GetActiveDgnModelP();
        TextBlockPropertiesPtr tbProps = TextBlockProperties::Create(*model);
        ParagraphPropertiesPtr paraProps = ParagraphProperties::Create(*model);
        RunPropertiesPtr runProps = RunProperties::Create(*DgnTextStyle::GetActive(), *model);
        tbProps->SetIsViewIndependent(true);
        paraProps->SetJustification(alignment);

        runProps->SetColor(Color);
        runProps->SetFontSize(fontSize);
        TextBlockPtr textBlock = TextBlock::Create(*tbProps, *paraProps, *runProps, *model);

        textBlock->SetProperties(*tbProps);
        textBlock->SetUserOrigin( Point );
        textBlock->SetOrientation( Matrix );

        textBlock->AppendText( WTxtString );

        if (TEXTBLOCK_TO_ELEMENT_RESULT_Success != TextHandlerBase::CreateElement(textElm, NULL, *textBlock))
        {
        }
--------------------

The CONNECT can not display text. There must be some problem. Anybody can give me some hint?

Best,

       


[C#\MDL V8i] Possible to force element to show fill even if Fill flag is disabled?

$
0
0

In MicroStation Connect, you are able to set an "Always Filled" property when creating a Shape using the DgnPlatformNet API. This causes the shapes to display as filled regardless of the views "Fill" property.

When creating these elements in Connect and opening the DGN in V8i, the elements will appear filled regardless of the views "Fill" property.

If I try to create a shape in V8i and set the fillmode to filled, the fill only displays if the views fill property is enabled.

I have tried using "mdlElmDscr_addFill", but this does not seem to display the fill if the display flag is disabled.

Thanks,

Maury

[CONNECT C++] duplicating function "mdlText_create"

$
0
0

Hi,

Is there anybody try to duplicate function "mdlText_create" using new CONNECT MDL SDK?

The new CONNECT MDL SDK makes it so complicate to create simple text!!!

Thanks,

[CONNECT C++] mdlTag_freeValue not in library files

$
0
0

Hi

I have som old code that I try to compile on MicroStation CONNECT Edition. This code uses the mdlTag_freeValue function. But I cannot find this function in the library files. Is this missing from the library or am I missing something obvious here?

regards

Frode Tørresdal

[V8i MDL] How can I Facetise Non-Planar Shapes?

$
0
0

The attached DGN shows a pipe design with a few elbows.  An unknown third-party app., probably not MicroStation-based, created this object.  It is constructed from a number of shapes, some non-planar, all in a cell.

As you can see, some shapes are non-planar.  My extraction app. wants to export a facetised data set, which one might assume would be straightforward.  However, the faceting doesn't  work with non-planar shapes.  The non-planar components are unavailable in the third-party viewer.  Yet MicroStation can visualise these non-planar shapes.  How should I create facets from non-planar shapes?

(Please visit the site to view this file)

[V8 MDL] cells & associative dimensions

$
0
0

Hi everyone,

I have a problem with cells containing associative dimensions.

-          Using the user interface to place the cell in a DGN, the dimension is still associative to the lines.

-          Using: “mdlCell_placeCell(NULL, NULL, TRUE, NULL, NULL, 0, FALSE, 0, 0, _wsCellName.c_str(), pLibraryObj);” to place the cell in a DGN, the dimension is still associative to the lines.

BUT… I like to modify the cell bevor adding it to the DGN, so I go the “normal” way:

-          “mdlCell_getElmDscrExtended(&_pOrignalCell, NULL, NULL, NULL, NULL, TRUE, ACTIVEMODEL, NULL, NULL, 0, 0, TRUE, TRUE, _wsCellName.c_str(), p_LibraryObj);”

-          No modification, but this does not matter.

-          “mdlElmdscr_add(_pOrignalCell);”

Now the association of the dimensions is gone.

Is there a way to re-associate the dimensions?

I know, there could be a workaround with “mdlCell_placeCell()”, but this would complicate things in other parts.

Thanks a lot

Volker

Viewing all 4331 articles
Browse latest View live