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

How can i create a ComboBox like the System Tools->Attributes->Active Level Combobox?

$
0
0

I used mdlLevelList_getLevelNamesWithAttributes to get the level listmodel,and passed it to my Combobox.

The problem is when i use mdlDialog_comboBoxSetPopupState to make my ComboBox dropdown listbox stay opening,I found it'll cause a fault.

I chick the second col to display my level like the system do. .

Here I use mdlDialog_comboBoxSetPopupState to make the dorpdown stay opening in hook with the message DITEM_MESSAGE_STATECHANGED.

Then I chick the system level combobox.

It actually shows my ComboBox dropdown.

I tracked the hook message,and found that there is no focusout in Toolbox.This maybe why the fault caused.

Here is my  Rscs:

DialogBoxRsc DIALOGID_Operate = 
{
DIALOGATTR_DEFAULT | DIALOGATTR_GROWABLE | DIALOGATTR_DOCKABLE,
0,0,
NOHELP,MHELP,
NOHOOK,
NOPARENTID,
"",
{
{{0,0,0,0},ToolBox,TOOLBOXID_PC,ON,0,"",""},
}
};

DItem_ToolBoxRsc TOOLBOXID_PC =
{
NOHELP, MHELPTOPIC, NOHOOK, NOARG, 0, "",
{
{{10,0.5*YC,12*XC,1.5*YC}, ComboBox, COMBOBOXID_DataLevel, ON, 0, "", ""},
}
};

//
DItem_ComboBoxRsc COMBOBOXID_DataLevel =
{
NOCMD, LCMD, NOSYNONYM, NOHELP, MHELP,
HOOKITEMID_DataLevel_ComboBox, NOARG,
128, "", "", "", "", NOMASK,
0, 12, 0, 28*XC, 0,
COMBOATTR_DRAWPREFIXICON | COMBOATTR_READONLY,
"",
"",
{
{12*XC, 128, ALIGN_LEFT, ""},
{4*XC, 128, ALIGN_LEFT, ""},
{4*XC, 128, ALIGN_LEFT, ""},
{4*XC, 128, ALIGN_LEFT, ""},
}
};

If someone have done something like this befor?


Remove Element Permanently ( Removed Element Must Not display even if user Undo the Process ) Using MDL Language.

$
0
0

Hi Guys,

Here is my code for deleting the element.


mdlElement_read(&MsElm,MASTERFILE,*FilePos);
mdlElement_undoableDelete(&MsElm,*FilePos,TRUE);

Working Fine, deleting the specified File Position.

If user undo the process by clicking Ctrl + Z or Edit -> Undo deleted element must not display(Element must be deleted Permanently).

[V8i] How can I Compare the direction of two lines.

$
0
0

Hi!

I have two lines to compare direction.( to check two line go same direction or not.)

I made two Ray3D objects from the lines like below.

Dim oRay_Cell       As Ray3d
Dim oRay_Line As Ray3d
oRay_Cell = Ray3dFromPoint3dStartEnd(oLineFromCell.startPoint, oLineFromCell.EndPoint)
oRay_Line = Ray3dFromPoint3dStartEnd(oLineFromLine.startPoint, oLineFromLine.EndPoint)
But I don't know how to compare the direction.
oRay_Cell.Direction ,,,,, oRay_Line.Direction

MDL application to Develop

$
0
0

Hello,

I would like to ask if it is possible to create an application where in there is a dialog box having buttons and when I click that button it has a process where made from MVBA Macro converted to MDL? Please see image below.

Thank you.

Best Regards,

Aldrin

[V8i] VBA TextNodes

$
0
0

How can I find the total number of line in a text node? In the code below, I am scanning the first line on a textnode and if the text matches, it is added to the display set. But what if the text is on the third line or fourth line? Specifying a line number works but it comes up with an error for any textnode that doesnt have the same number of lines. For example if I am looking for the third line of a textnode and the textnode the enumerator is scanning an element that has only two lines, the program gives an error. Not having the functionally of a complex element, how do I create an array or a 'for' statement to loop through the lines?

Thank you


    oScan.ExcludeAllTypes
    oScan.IncludeType msdElementTypeTextNode
   
    For Each oAttachment In ActiveModelReference.Attachments
    Set oEnum = oAttachment.Scan(oScan)
    While oEnum.MoveNext
        With oEnum.Current
            If .Type = msdElementTypeTextNode Then
                Set oElem = oEnum.Current
                textvalue2 = oElem.AsTextNodeElement.TextLine(1)
                If InStr(textvalue2, textstring) <> 0 Then
                oElem.InDisplaySet = True
                End If
            End If
        End With
    Wend
    Next

 

converting mdlArc_createByPoints to vba CreateArcElement2

$
0
0

I am rewriting an mdl application in vba and got stuck when trying to substitute CreateArcElement2 for mdlArc_createByPoints. Is there some math guru out there who can tell me how to calculate the primary radius, secondary radius, sweepangle and get the center point for an arc when you start out with 3 points on the arc? I tried using the original mdl call (see codebelow) but it crashed MicroStation and I couldn't figure out why, so I thought I'd try a vba fucntion instead.

 

    Dim points(3) As Point3d
   

   Dim arcEl(0 To 250000) As Byte

    status = mdlArc_createByPoints(arcEl(0), ByVal 0, points(0))

Any ideas what I can do?

 

Thanks,

Stephanie

MDL project "basic" extension files

$
0
0

Hello,

I  would like to create a dialog box and I used basic as guide or an example however , I'm confuse of the two files which are .mc file and .cpp file. From the delivered examples of SDK, all examples has .cpp file but in MDL Programmer Guide, there is no explanation about .cpp file. 

Best Regards,

Aldrin

MDL Error running basic from SDK

$
0
0

Hello,

Before, I was able to run basic however, when I modified its contents I encountered error. After getting error  I deleted the one I modified that has an error and replace the original basic. When I run the original basic, I encountered error. See image below.

BMAKE: call trace

line: 442, C:\PROGRA~1\Bentley\MICROS~1\MICROS~1\mdl\include\dlmlink.mki

line: 95, C:\MDLProject V8i <SELECTseries>\basic\basic.mke

Can someone help me to run the basic without error.

Best Regards,

Aldrin

 


VBA: View Display setting of a reference attachment Level

$
0
0

Is the View Display setting of a reference attachment available through VBA somewhere? I want to know whether a Level of an Attachment is shown in View 1 or not. In the Attachments I can Find Levels which have the IsDisplayed Property, but this is the Global Display Setting, not the View Display setting.

I can find references to the IsDisplayedInView and IsEffectivelyDisplayedInView Properties, but I can't seem the find these for Reference Attachments.

Is this something that used to be available in older versions of Microtation or am I missing an option somewhere or do I need MDL to find the View Display Settings of a reference attachment?

Or must I open the Attachment for Program, or how can this be done with VBA preferably? I'm either finding the Global Display setting, or the View settings of the active model.

Thanks to any who can shed some light on this.

Change the text color in v8i

$
0
0

Hi friends,

     I migrated the code from V8xm to V8i and compiled the code successfully but the text color is not changing in the string list.I have mentioned the code below.

         mdlStringList_getMember( NULL, &infoFieldsP, strListP, flag);
          *(infoFieldsP + 1) = (long) listboxGlobs.localColorsP[6];

In the above code, the color is changing in V8XM but the color is not changing in V8i. Anyone please give me the solution.

Thanks and Regards,

Saran.

Set Element Transparency ( Microstation V8i Using C# .Net Language)

$
0
0

Hi Guys,

Requirement : Scan all shape elements(polygons) in active dgn and then make them fill and set transparency.(Fill mode on off)

buy using below code i am giving 30 percentage transparency ( txt_trans_per.Text ) but it is applying with 100 percent.

please let me know where i am doing mistake .

BIM.Application mstnApp = BMI.Utilities.ComApp;
BIM.ElementScanCriteria esc = new BIM.ElementScanCriteriaClass();
esc.IncludeOnlyVisible();
esc.ExcludeAllTypes();
esc.IncludeType(BIM.MsdElementType.Shape);
BIM.ElementEnumerator ee = mstnApp.ActiveModelReference.Scan(esc);
            
if (BtClick == false)
{
         while (ee.MoveNext())
          {
                    BIM.Element Elm = ee.Current;
                    Elm.AsShapeElement().FillMode = BIM.MsdFillMode.Filled;
                    Elm.Transparency = Convert.ToInt32(txt_trans_per.Text);
                    mstnApp.ActiveModelReference.ReplaceElement(Elm,Elm);
           }

           BtClick = true;
           Bt_FillMode.Text = "Polygon Fill Mode : OFF";

}

else
 {
                while (ee.MoveNext())
                {
                    BIM.Element Elm = ee.Current;
                    Elm.AsShapeElement().FillMode = BIM.MsdFillMode.NotFilled;
                    Elm.Transparency = 0;
                    mstnApp.ActiveModelReference.ReplaceElement(Elm, Elm);
                }
                BtClick = false;
                Bt_FillMode.Text = "Polygon Fill Mode : ON";
}

VBA to Load Key-in Command

$
0
0

I wanted to setup and F Key, which I do know how to do. Only I wanted one to load the Key-in. I know the Utilities, pull down and the top item is Key-in When I use that it is fine and the courser is blinking on the line to put in a command. Tried to show example. When I made a simple VBA to open this window the courser is not blinking. you have to use the mouse to move up and click in the space to type??

 

Simple VBA:

Sub KeyInOpen()
' 110513 - New Test on key-in
'   Start a command
    CadInputQueue.SendCommand "DIALOG CMDBROWSE"

'   Send a keyin that can be a command string
    CadInputQueue.SendKeyin " "                           ' I tried it with this line and w/o it will not seem to effect where the courser goes.

End Sub

 

Example of already set F Keys

Someone out there give me a little help. I did do some searches in the help files, but did not get one on this to come up?

 

 

 

[V8i VBA] Raster - How do you access the Raster Attachment Aspect Ratio property?

$
0
0

I need to access the Raster Attachment "Aspect Ratio" and change the property from locked to unlocked.
Does anyone know how to change the Aspect Ratio property using VBA?
So far I haven't been able to find anything so any help would be most appreciated.

TIA Steve

how to Implement the stitch function in MDL application

$
0
0

the MS has the function of stich surfaces, keyin"construct stitch"".

now i want to do this in my MDL application, but i can't find useful functions.

as the pic shows, there are 15 shapes, i want to stitch them together as a smart surface.

which function i supposed to use ?

thank you!

Create Region Flood

$
0
0

Hi Guys,

By using the Keyin ( Create Region Flood ) we can create and add shape at closed locations.

Please find the attached Image.

In this image you can see the dgn having more number of closed areas.

So instead of creating Flood area using Keyin one by one location.

User raised a request to develop a tool for creating the flood area at closed location by clicking on a single button(created programmatically).

So the requirement is when user click on button

1) How to find out the closed areas ?

2) How to generate the flood areas ?

3) How to assign the Index for flood area for example : each flood area must have an index number at center 1,2,3,4, etc .......


How to cut solid by surface in MDL application

$
0
0

MS has a  tool "Cut Solid by Curves".

I want to cut solid using a surface in my MDL application.

which function i supposed to use?

Will mdlKISolid_trimByEdgesAndFaces be useful in this case ?

as the pic shows, i want to cut/split the solid by the complex surface.

Any replies will be appreciated.

processing only snapped elements with a polygon

$
0
0

Dear All,

I need to process only  those elements where the ends (start point or end point) are exactly snapped to a polygon. Could you please help me to achieve this.

Regards,

K.JAYAKUMAR

Start Microstation from vba with user and workspace?

$
0
0

Hi all,

I am trying to launch Microstation from an external program using Visual Basic.

How can i define the user and the workspace that i want to launch Microstation in ?

so far i have this:

Dim BMAPP As New MicroStationDGN.Application
BMAPP.Visible = True
Dim dgnfile As MicroStationDGN.DesignFile
dgnfile = BMAPP.OpenDesignFile("location of file,.....")
Is there any way that i can specify these variables?
Thanks?
p.s. I would prefer not to use the L.A. Solutions Microstation Detector...

Start Microstation from vba with user and workspace?

$
0
0

Hi all,

I am trying to launch Microstation from an external program using Visual Basic.

How can i define the user and the workspace that i want to launch Microstation in ?

so far i have this:

Dim BMAPP As New MicroStationDGN.Application
BMAPP.Visible = True
Dim dgnfile As MicroStationDGN.DesignFile
dgnfile = BMAPP.OpenDesignFile("location of file,.....")
Is there any way that i can specify these variables?
Thanks?

[V8i SS2] Error when loading dll for MDL.

$
0
0

Hi experts.

Has anyone encountered error below?

 

This dll is ok when run to my pc but when running this on a newly reformatted pc, this error is encountered.
Is there any prerequisite that needs to be installed that causes this error?

Thanks!

Viewing all 383 articles
Browse latest View live


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