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

Zoom In Out Key in's with out placing point on dgn

$
0
0

Hi Guys,

Need to zoom in and out based on view center point.

instead of scrolling mouse in and out.

user will use function keys for zoom in out.

for example: for zoom in user will click on function key F2 out user will click on function key F3.

i am using the keyin "zoom in" but it is asking select point to zoom about.

How can i zoom in and out without selecting point ?


Need VBA Code Example: How to select a specific type of element in a reference file

$
0
0

MicroStation V8i V 08.11.09.937. Does anyone have a code example that demonstrates how to select an element in a reference file? I want to be able to automatically select a shape in a reference file and define a fence using the vertex coordinates. I am somewhat familiar with scan criteria, but so far have only been able to retrieve elements in the open file using the "ActiveModelReference.scan(myfilter)" method.

ISSD in Microstation V8i

$
0
0

Hi Guys,

Need to check where the view is in stereo mode or microstation mode when ISSD loaded in microstation v8i.

Actual problem is when ISSD loaded in microstation V8i Zoom in and Out functions are not working in stereo mode.

So i designed a tool for zoom in and out using keyin's ("issd stereo zoom 0.5;selview 1;issd roam")

This keyin will work when stereo mode is active.

But if user is in microstation view , How can i check the view is in stereo or microstation ?

[VBA] Need help with MDL Wrapper Function for mdlSheetDef_setBorderAttachmentId

$
0
0

The documentation when followed generates the following error message:

Bad DLL calling convention (Error 49)

While this error has a help page, it does not explain any specific corrective action that can be done.

The Wrapper statement, from the MDL help is:

Declare Function mdlSheetDef_getBorderAttachmentId Lib "stdmdlbltin.dll" ( ByVal sheetDefIn As Long , ByRef borderAttachmentIdOut As DLong ) As Long

There is also a property in the VBA SheetDefinition object named MdlSheetDef that, according to its help "Retrieves the associated SheetDef pointer that a program can use as an argument to MDL mdlSheetDef functions."

With no example, we cannot determine how to use this or even if this is the way to use the subject wrapper function.

We seem to have hit a brick wall on this and need help from a Bentley Programmer.

read a dgn/seed file in microstation vba without opening it

$
0
0

Hi,

I have to write a small vba that will check dgn files, to see if the levels inside will match those from the seed file. Is it possible to read the seed file (to get the level names and properties) somehow without open it then check the active dgn?

Thanks,

e.g. 

Export coordinates from elements (cells)

$
0
0

Hello,

Is it possible to export a list of coordinates from elements (cells).
Coordinates are in this case based on a grid drawn on  the dgn and not the effective Microstation coordinates.

I would like to scan a drawing for a particular element (cell) and check for each element (always the same element or cell) where it is located in the grid of the drawing and then export this information (TXT, XLS, CSV ...)

Example:
On top and on the right of a layout drawing I have drawn a grid.
On top, from right to left it is named "1" to "40".
On the right side, from top to bottom it is named "A" to "Y"
Spacing of this grid, for example, 30mm.

On this drawing I have place a large number of a cell. For example the cell "EH-FLS". 
Now I want to generate a list indicating me where each one of these cells is located on the dgn.

Result, for ex.: 

Name         | Column | Line
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
EH-FLS      |    12     |    E
EH-FLS      |    12     |    G
EH-FLS      |    17     |    J
EH-FLS      |    22     |    L
EH-FLS      |    23     |    N
EH-FLS      |    25     |    P
x
x
x

Is something like this possible??

Thank you
Best regards
Raphael 

Re: SetCustomProperty Question

$
0
0

Good afternoon,

When setting custom properties in a DGN (using SetCustomProperty), What is the maximum length a string could be?

Thank you.

[v8i VBA]

$
0
0

Hi All,

I need a clarification about Tag editing using VBA. My question is, Is it possible to Rename tag definition in a tgaset?

For e.g. In a Tagset called GS01 i have a tag definition Obj now I need to rename Obj as Object. please clarify.

Best rgrds,

Prasanna


[v8i VBA] Referencing embedded Excel

$
0
0

Programming with VBA in Microstation and wondering if there is a way to reference an excel worksheet embedded in microstation so I can input values into it.

Any help would be appreciated.

[XM VBA] UserForms not working properly after Place Text Tool used

$
0
0

I have just recently been tasked with developing tools to help automate some of the work we do in MicroStation.

In order to support this I have developed several userforms which all work as expected with one major, and very strange, exception.

If the user accesses the Place Text tool then the userforms will display, but will not function properly. Note that this happens even if no text is actually placed, all that needs to happen is for the user to select the tool. This occurs regardless of what text entry/editing selection is made under Workspace Preferences.

When this problem is active, and a userform is opened, if the user clicks anywhere on the diagram an "Enter characters first" status message is displayed in the command/prompt location.

The selected userform is actually active at the same time this is occuring. Values can be added or changed in textboxes, radio buttons and checkboxes cycle properly, etc.

It seems that when it comes time to take action for the IPrimitiveCommandEvents_Datapoint function associated with the selected userform, that microstation is not accessing my class to handle the event, and is instead still locked into the text editor's event handler.

I have found only two ways to clear the issue:

1. Shutdown and restart Microstation
2. Select the Edit Text tool, select any text on the diagram, restart the desired userform.

Note that text does not actually need to be edited, just as long as the text editor window comes up under the editing tool with the selected text displayed. Once this happens all the userforms are fully functional again, at least until the next time the Place Text tool is accessed.

Has anyone seen this type of behavior before? Any suggestions on how to handle the issue, or what may cause this type of problem?

Micorstation select series 2 V8i c#/VBA

$
0
0

All,

I am trying to locate the element in the design file using its MSLINK. When I use enumerators scanning process was too slow, looping through each element and then checking the MSLINK.

Is there any API like mdlscancriteria in c#  which will be faster OR any example to use C++ mdlScanCriteria API from c#.

Really appreciate your help on this.

temporary graphics or "glow"

$
0
0

hello everyone.  I have a client that is looking for an application that will create temporary graphics representing specific points.  I thought of another method of doing this by have selection sets that would make the elements glow based on what the user is looking for.

For example, if the user wanted to find the justification of text in a file, I could either place temporary graphics pointing to the text justification points.

OR

I thought if I provided the user with a dialog box that the user could choose "center/center justification" and make the text with this justification "glow" somehow.  

Searches yielded next to nothing on either of these main points: temporary graphics or highlighting objects.

If you there are any ideas, I welcome them.

Thanks,

Mike

Tool aborts when upgrading V8 ma to V8i using Native code (C++ using mdl)

$
0
0

Hi Freinds,

One tool auto reference dgns,detach dgns and exchange the model (opening file) tool is working fine in microstation V8.04 series. And while upgrading same tool native code in Microstation 08.11 series is aborts while attaching and exchange models.And one thing i want to express about tool is working some time (4 to 5 view updates) and aborts from microstation.And for this tool while V8 version, i followed the instructions as per bentley forum replied people.It  works for V8 version microstation.

I have followed below process:

1) All auto process will be works with mdlView_setFunction (UPDATE_POST, someFunction) ;

And in this some function works below :

2) For attaching and exchange models will be working simple screen coordinates.

3) For detach dgns, i have process though command input through mdlInput_sendCommand by decoupling.

And i have tried all functionality by mdlInput_sendCommand, but same error.

My question is there any changes/updates are required in V8i version (or) need to follow in any another procedure.

I am much appreciable about Bentley forum for finding solutions/directions to resolve microstation activities.

Regards, Sreekanta.M

Convert MVBA Rotation.RowX.X to .NET.

$
0
0

Hello,

I would like to convert this line of code below to .Net:

If otextElement.Rotation.RowX.X  <> 1 then

In .Net  below is the line of the code I tried:

if(oTextElement.get_rotation)

However, I wasn't able to get RowX.X.

Can someone help me on this matter? Thank you.

Best Regards,

Aldrin

Error message caused into to the microstation v8i s3

$
0
0

Hello,

We are a company that uses MICROSTATION software to deploy our own solution “Dkmètre” that we have developed with the C and MDL languages.

Our solution operates correctly with the series 1 and 2 of the MICROSTATION v8i version, but updating MICROSTATION to the series 3 generates some bugs in the Dkmètre solution.

These bugs occur as a message error when we modify the content of components as Text component, combo box component...

You will find attached a screen capture of the error message.

So, I'd like to have some details about these bugs.

Cordially.


[XM VBA] Accessing Dimension Note in VBA

$
0
0

I'm looking for someone who has had any success in accessing a "NOTE" in VBA. When selecting a note with  a leader in the MicroStation GUI, it shows in the information window as a Dimension and a Note. For the life of me, I cannot figure out how to access the text that makes up the note. I saw some code in this forum that created a dimension note but it gave me no real insight as to how to, programmatically access the text.

Any assistance would be greatly appreciated.

sdk and microstation version

$
0
0

Hi Everybody

I have downloaded microstation SELECT series 3(08.11.09.292)  from bentley (30 day trailer version) but i cannot find ss3 microstation SDK. how  i can get it to  tart my mdl programming?

why i can not  find  English version article which is called  Learning MicroStation MDL Step by Step [0] to [7] ?(Just Chinese version is access able through BDN)

Please help me

Convert oTextElement.ID.Low to C# Addin

$
0
0

Hello,

I would like to get the ID of Element in the drawing. In VBA i used oTextElement.ID.Low in getting the ID.  In C#, I tried to use oTxtElement.GetSubElements().Current.ID but there is no Low.

Can someone help me convert ID.Low to C# code?

Thank you.

Best Regards,

Aldrin

Lock a Level on the pull down, via Key-in or VBA

$
0
0

I have a tool bar button that brings on Level 5 and sets the various colors, weight and style

Sub ActiveLayerSet5()
' 110413 - Changed command, removed Dim commands and the Command CommandState.StartDefaultCommandStart command
' 09/23/2013 -   SetCExpressionValue "tcb->symbology.color", 5, "MGDSHOOK" {This sets the actual color a -1 uses the bylevel}
' 021313 - Tested again,

'   Start a command
    CadInputQueue.SendCommand "ACTIVE LEVEL ""Level 5"""
   
    '   Set a variable associated with a dialog box
    CadInputQueue.SendCommand "ACTIVE Color Violet"
    CadInputQueue.SendCommand "ACTIVE STYLE 0"
    CadInputQueue.SendCommand "ACTIVE WEIGHT 0"
    
    CadInputQueue.SendKeyin "level set lock ON Level 5"
    CadInputQueue.SendKeyin "m,msLevel 5 Lock = ON"
       
    CadInputQueue.SendCommand "m,ms    Active Level=5    Color 5,  Style 0, Weight 5"  'Send Msg Center Box
   
End Sub

as soon as I turn on 5, my temporary level. I have to do the manual pull down and turn on the padlock to lock the layer. (I have a reason for all this)  I tried to find a key-in to turn the lock on , searched in ask Inga, found several on locking other things. I want through an array of Key-in commands attempting to find mine?

If there is a Key-in I can make it work, or if a VBA command, that would be great. If I get the one I can figure out the other. I did try to copy this with the Basic Macro and it got nothing in-between

' Turn on Level 5 Lock

Sub main
    Dim startPoint As MbePoint
    Dim point As MbePoint, point2 As MbePoint
End Sub

 I went through the pull-down step, went to 5 and turned on the lock symbol, but you can see none of it was recorded?

 

VBA Recording:

Sub Macro1()
    Dim startPoint As Point3d
    Dim point As Point3d, point2 As Point3d
    Dim lngTemp As Long

'   Start a command
    CadInputQueue.SendCommand "ACTIVE LEVEL ""Level 5"""

    CommandState.StartDefaultCommand
End Sub

Still did not pickup setting the lock, can someone help on this one?

Bug caused BY the mdlState_startPrimitive function

$
0
0

Hello

We are a company that uses MICROSTATION software to deploy our own solution “Dkmètre” that we have developed with the C and MDL languages.

 

One of the functionalities that Dkmètre offers is “placing terrain points”.

The user selects this feature from a range of Dkmètre added at MICROSTATION, then, he places a point in the DGN. Later, a command box is automatically opened asking the user to enter the altitude of the point.

This feature works often properly, but when we change the current DGN file without closing Dkmètre (so, not reset variables used in Dkmètre) and we chose this feature in the new DGN file it does not work and it causes a bug.

Debugging Dkmètre code  shows that the bug is launched after executing the mdl function “mdlState_startPrimitive( DkmComposite_FirstPoint, DkmComposite_StartCommand, MesDKM_Place_Courbe_Composite, MesDKM_Entree_le_premier_point_de_la_courbe );”

 I note that the DkmComposite_FirstPoint function is the function called when the user chooses to place a new terrain point.

You find bellow the code source of the functions DkmComposite_FirstPoint and DkmComposite_StartCommand and the values of the constants MesDKM_Place_Courbe_Composite and MesDKM_Entree_le_premier_point_de_la_courbe  

#define MesDKM_Place_Courbe_Composite        1168 

#define MesDKM_Entree_le_premier_point_de_la_courbe       654 

DkmComposite_FirstPoint

void DkmComposite_FirstPoint( Dpoint3d * point, int view )
{
int status = 0;
/**/ST_ARTICLEMETRE articleMetre;/**/

paramEtudeP->recupererSymboDessin = FALSE;

if( glbP->composite.orientationObjets != 2 )
if( DkmComposite_saisieZ( glbP->composite.orientationObjets == 0 ? point : &glbP->composite.dernierPt, status, view ) == ERROR )
return;

if( glbP->composite.orientationObjets != 1 )
{
DkmComposite_forcePlanaire( point, view, TRUE, FALSE );
glbP->composite.dernierPt.x = point->x;
glbP->composite.dernierPt.y = point->y;
glbP->composite.dernierPt.z = 0.0;
glbP->composite.tg.x = glbP->composite.tg.y = 0.0;
glbP->composite.tg.z = 0.0;
}

	glbP->composite.commandeStarted = TRUE;

DkmComposite_enableOptions( NULL );

if( glbP->composite.objets )
{
if( glbP->composite.orientationObjets == 2 )
glbP->composite.orientationObjets = 1;
else
DkmComposite_StartCommand( );
}
else
DkmComposite_StartSegment( );
}

DkmComposite_StartCommand

void DkmComposite_StartCommand( void )
{
mdlOutput_message( DkmMessage( MesDKM_Entree_Le_point_suivant_de_la_courbe ) );

mdlState_startPrimitive( DkmComposite_FirstPoint, DkmComposite_StartCommand, MesDKM_Place_Courbe_Composite, 
MesDKM_Entree_le_premier_point_de_la_courbe );

mdlState_setFunction( STATE_COMPLEX_DYNAMICS, DkmComposite_Curseur );
mdlState_setFunction( STATE_COMMAND_CLEANUP, DkmComposite_CleanUpFunction );
mdlState_setFunction( STATE_RESET, DkmComposite_resetRestartCommand );

mdlSystem_setFunction( SYSTEM_SYMBOLOGY_CHANGE, __DkmComposite_SymbologyChanged__ );
mdlSystem_setFunction( SYSTEM_LEVEL_CHANGE, __DkmComposite_SymbologyChanged__ );

glbP->composite.dgnModelRef = MASTERFILE;
glbP->composite.commandeStarted = FALSE;
glbP->composite.orientationObjets = 0;
glbP->composite.angleObjet = 0.0;

DkmComposite_enableOptions( NULL );

mdlAccuSnap_enableSnap( TRUE );
mdlAccuSnap_enableLocate( TRUE );
}


the bug starts at the code written in red

 

Viewing all 383 articles
Browse latest View live


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