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

[V8i MDL] Get start angle of torus

$
0
0

I'm using mdlSurface_extractRevolution2() to analyse a torus.  That's fine, but there's a missing piece of information: the start angle of a partial torus.  The function tells me the sweep angle, but not the start angle.

If I use the Element Analyse tool to examine the torus, then it tells me about the arcs that are used to display the shape in wireframe.  But those arcs don't exist in the model, so I can't measure them with MDL.

Any suggestions?


re: CONNECT SDK & Windows 10

$
0
0

Has any body, had any success in comping any of the CONNECT SDK examples (BasicDialogBox) inside a Windows 10 environment?
Or is it just me.  Within Windows 7, works just fine.

[CONNECT C++] empty TextBlock

$
0
0

Hi,

I tried to create a text element. I got a return value which says"it did not have the force text node flag".

Which command can be used to set "text node flag"?

Thanks

TextBlockToElementResult EleTxtReturn = TextHandlerBase::CreateElement(eeh, NULL, *textBlock)

EleTxtReturn = TEXTBLOCK_TO_ELEMENT_RESULT_Empty

C# example delivered with the latest MSTN Connect SDK

$
0
0

I built 2 c# samples delivered with the latest MSTN Connect SDK: WPFSample & Bentley.DgnIModelNETExample, I got the dlls also the addin loader ma files (under C:\Users\{username}\AppData\Local\Temp\Bentley\MicroStation\10.0.0\AddInLoader1.0)

but I can't load the .ma file in mstn v10.02.00.39, do I still need to load .ma to subsequently load the addin? if not, how do I load the addin

Thanks

[CONNECT C++] Element Handlers

$
0
0

Hi all,

First of all, let me apologize in advance if this comes across as a little incoherent. I'll do my best to state what I am trying to achieve.

I am trying to develop an application that can place a series of cell elements linearly. Which is easy enough, and I can accomplish this no problem.
I would then like to be able to use the standard MicroStation selection tool to select one or all of my series of cell elements and for MicroStation to display my own custom manipulators on top of these elements (I believe this can be done using view decorations and transient elements, etc.).

What I don't quite get is what is the best way to recognize these elements as a special type of element that should display my manipulators while my application is running.
Do I need to monitor element selection events and check each cell element for some piece of data that tells me that it belongs to my application, and then create the manipulators on screen.

Or, preferably, can I use the element handler classes to create my own special type of element (which inherits from cell elements) that I can provide callbacks to my own functions to handle displaying manipulators, etc.

Any pointers as to where I can find more information would be great.

Thanks
Liam

AUTO: Liam Wilks is out of the office on leave. (returning 12/09/2016)

$
0
0

I am out of the office until 12/09/2016.

Please contact Darren Heargraves or David Girvan if you have any issues

x7189.

I will respond to your email when I return.

Note: This is an automated response to your message "RE: [CONNECT C ]

Element Handlers [MicroStation Programming Forum]" sent on 5/09/2016

5:51:20 PM.

This is the only notification you will receive while this person is away.

DISCLAIMER

The following conditions apply to this communication and any attachments: VicRoads reserves all of its copyright; the information is intended for the addressees only and may be confidential and/or privileged - it must not be passed on by any other recipients; any expressed opinions are those of the sender and not necessarily VicRoads; VicRoads accepts no liability for any consequences arising from the recipient's use of this means of communication and/or the information contained in and/or attached to this communication. If this communication has been received in error, please contact the person who sent this communication and delete all copies.

[v8 VBA] Place linestring (continuous) using iprimitive command events

$
0
0

Dear all,

I want to draw continuous linestring using iprimitive command events in VBA (with some added info). I have gone through Help document.. I could find the example of line element creation but that one isn't a continuous linestring. I tried on my own but failed to make it work. Can anyone help me on this?

MOhan

set keyins in microstation v8 2004 edition?

$
0
0

Dear all,

               I am using Microstation v8 2004 Edition. I set the key-ins to the function keys (F1 to F12) for easy access of the tools its working fine but i am trying set the key-ins to all keys in the keyboard (EX: A - Place line,B - Place arc etc...) .if  i am press A key in the keyboard place line key-in is need to be work. any one tell me is possible or not.

Regards,

Karthik


[V8i MicroStationAPI] ElementFacetSet

$
0
0

The ElementFacetSet class provides plenty of information about the facets it holds.  Unfortunately the methods that reveal the information are sparsely documented in MicroStationAPI help.

For example...

  1. How are points (obtained using GetPoint()) and point indices (obtained using GetPointIndices()) related?
  2. Are facets always (a) triangular, (b) rectangular or a mixture of those?
  3. What does GetNumPerFace() tell us?
  4. Are ElementFacetSet and PolyFaceArrays related?

[C# Connect] Creating Meshes

$
0
0

In the past I have posted about trying to utilize PolyfaceHeader::CreateXYTriangulation in C#, however it is only available in native code.

Today, I was looking through the assemblies packaged with MicroStation Connect and noticed TerrainModelNET. 

I have referenced in this dll and I am able to add points and triangulate a DTM (among other useful things), however, I do not see any way of converting this into a mesh element.

Does anyone have any insight into how to use the TerrainModelNET API?

[CONNECT C++] Text/properties/formatting

$
0
0

Hi,

I used "textblock" created a string of text. I found out that the text length and width are zero (from text property/formatting).

I used following code.

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

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

......
            textBlock->SetUserOrigin(Point);
            textBlock->SetOrientation(Matrix);
            textBlock->AppendText(WTxtString); .....

How can I set the text width and height.

Thanks,

[CONNECT C++] Sprites

$
0
0

How do we create Sprites under connect?

I believe the function used to load these under the V8i SDK was Bentley::Ustn::ISprite::CreateFromIconResource (int rscId, void *hInstance).
There was also a function Bentley::Ustn::IViewManager::CreateSpriteFromIcon (HICON__ *).

However in CONNECT nether of these are declared in the header files.

A dump from mdlbltin.lib reveals that some form of these functions exist.

Symbol name : ?CreateSpriteFromIcon@IViewManager@DgnPlatform@Bentley@@QEAAPEAUISprite@23@PEAUIcon@BeIconUtilities@3@_N@Z (public: struct Bentley::DgnPlatform::ISprite * __cdecl Bentley::DgnPlatform::IViewManager::CreateSpriteFromIcon(struct Bentley::BeIconUtilities::Icon *,bool))
Name : ?CreateSpriteFromIcon@IViewManager@DgnPlatform@Bentley@@QEAAPEAUISprite@23@PEAUIcon@BeIconUtilities@3@_N@Z
Symbol name : ?LoadSpriteFromRsrc@IViewManager@DgnPlatform@Bentley@@SAPEAUISprite@23@HPEAUIconSource@BeIconUtilities@3@@Z (public: static struct Bentley::DgnPlatform::ISprite * __cdecl Bentley::DgnPlatform::IViewManager::LoadSpriteFromRsrc(int,struct Bentley::BeIconUtilities::IconSource *))
Name : ?LoadSpriteFromRsrc@IViewManager@DgnPlatform@Bentley@@SAPEAUISprite@23@HPEAUIconSource@BeIconUtilities@3@@Z

Am I missing something? Without these functions available how do we utilize sprites? Or is it recommended that we continue using transient elements?

Thanks
Liam

[CONNECT C++] Single line of text string

$
0
0

Hi,

The text block is too complex for simple use.

I just need print out just one line of text. Is there a simpler way to print out single run of text?


Best,

[CONNECT C++] TextBlock location and size

$
0
0

Hi,

I double checked class textblock methods. I did not find out there is any methods to set textblock size.

Is there any way to set every run of text location?

Best,

[CONNECT C++]Get current location.

$
0
0

Hi,

Is there any methods to get current mouse or cursor location (Coordinates)?

Thanks


(v8i VBA) Returning the XY range of a shape element to a form

$
0
0

I am writing a VBA code for microstation that will allow the user to select an element, the macro will determine if it's a shape or complex shape, and return the max/min XY values for the entire element to the form to process there.  I have been using the ILocateCommand Processes, and I have had some problems making sure the commands accept only shape or complex shape files, and returning the min/max XY values back to the form code is not working. I've made the information "public," and I've been on these forums for about three days now, and have found nothing that fixes my problems.  Any help would be greatly appreciated.

Also, I know my code is a mess, so don't judge. (I'm still learning)

This calls the ILocateCommand class module:

Sub BtnDefine_Click()
Dim oIDele As New IDele
Dim TextXmax As Double
Dim TextYmax As Double
Dim TextXmin As Double
Dim TextYmin As Double
Dim Hpoint As Point3d
Dim Lpoint As Point3d
Dim Xmax As Double
Dim Xmin As Double
Dim Ymax As Double
Dim Ymin As Double

Me.Hide

    CommandState.StartLocate oIDele

TextXmax = Hpoint.X
TextYmax = Hpoint.Y
TextXmin = Lpoint.X
TextYmin = Lpoint.Y

Xmax = TextXmax
Xmin = TextXmin
Ymax = TextYmax
Ymin = TextYmin

Debug.Print TextXmax
Debug.Print TextXmin
Debug.Print TextYmax
Debug.Print TextYmin

End Sub

Then This is the Class module:
Option Explicit
Implements ILocateCommandEvents

Private pointloc As Point3d
Public Property Let Points(ByRef Lpoint As Point3d, ByRef Hpoint As Point3d)
    Lpoint = pLow
    Hpoint = pHigh
End Property
Function MoreMath()
Dim Element As ShapeElement
Dim Ele As Shape
Dim pLow As Point3d
Dim Point As Point3d
Dim MyVertList As VertexList
Dim pHigh As Point3d

Ele = Element
MyVertList = Ele.AsVertexList

pLow.X = CStr(Ele.Range.Low.X)
pLow.Y = CStr(Ele.Range.Low.Y)
pHigh.X = CStr(Ele.Range.High.X)
pHigh.Y = CStr(Ele.Range.High.Y)

Debug.Print pLow.X
Debug.Print pLow.Y
Debug.Print pHigh.X
Debug.Print pHigh.Y

End Function
Private Sub ILocateCommandEvents_Start()
Dim oScanCrit As LocateCriteria
Set oScanCrit = CommandState.CreateLocateCriteria(False)
CommandState.SetLocateCriteria oScanCrit
oScanCrit.ExcludeAllTypes
oScanCrit.IncludeType msdElementTypeShape
oScanCrit.IncludeType msdElementTypeComplexShape

ShowCommand "Identify Element"
ShowPrompt "Select Element to Identify"

End Sub
Private Sub ILocateCommandEvents_LocateFilter(ByVal Element As Element, Point As Point3d, Accepted As Boolean)

End Sub
Private Sub ILocateCommandEvents_Accept(ByVal Element As Element, Point As Point3d, ByVal View As View)
Dim Ele As ShapeElement
MsgBox ("Element Accepted")
MoreMath
UserForm1.Show

End Sub
Private Sub ILocateCommandEvents_Dynamics(Point As Point3d, ByVal View As View, ByVal DrawMode As MsdDrawingMode)

End Sub
Private Sub ILocateCommandEvents_LocateFailed()

MsgBox ("Invalid Element; Element must be a shape or complex shape")

End Sub
Private Sub ILocateCommandEvents_LocateReset()
UserForm1.Show

End Sub
Private Sub ILocateCommandEvents_Cleanup()
Unload Me

End Sub


And this is what my form looks like:


I may be making this too complicated, I can't tell anymore.

Len

[CONNECT MicroStationAPI] IViewManager::LoadSpriteFromRsrc missing

$
0
0

The MicroStationAPI documentation about Sprites mentions static method IViewManager::LoadSpriteFromRsrc().  However, that function is not available in any public header file.

Shouldn't that function be published?  Is there another way to load a sprite image?

.

[CONNECT C++] Text location was offset

$
0
0

Hi,

I am using two kind of methods to draw text. I got different drawing.

I used old "mdltext_Create" API. The drawing show correctly.

        DgnPlatform::TextParamWide textParam;
        textParam.font = scGetTextFontFromName(pReader, Font);
        textParam.just = TextElementJustification::LeftBaseline;
        textParam.lineStyle_deprecated = 0;
        textParam.viewIndependent = 0;
        DgnModelP model = ISessionMgr::GetActiveDgnModelP();
        mdlText_create( pElement, NULL, WTxtString, &Point, &Matrix, &TextSize, &textParam, NULL, model );

I tried to use CONNECT SDK API TextBlock. The text drawing was offset some value.

        DgnModelRefP modelRef = ISessionMgr::GetActiveDgnModelP();
        double scale = mdlModelRef_getUorPerMaster(modelRef);

        DPoint2d fontSize;
        fontSize.x = Size * scale;
        fontSize.y = Size * scale;
        Point.x = Point.x * scale;
        Point.y = Point.y * scale;
        Point.z = Point.z * scale;

        TextBlockPropertiesPtr tbProps = TextBlockProperties::Create(*ISessionMgr::GetActiveDgnModelP());
        ParagraphPropertiesPtr paraProps = ParagraphProperties::Create(*ISessionMgr::GetActiveDgnModelP());
        RunPropertiesPtr runProps = RunProperties::Create(*DgnTextStyle::GetActive(), *ISessionMgr::GetActiveDgnModelP());
        tbProps->SetIsViewIndependent(true);
        paraProps->SetJustification(TextElementJustification::LeftBaseline);
        
        runProps->SetColor(Color);
        runProps->SetFontSize(fontSize);
        runProps->SetFont(*pDGNFont);
        TextBlockPtr textBlock = TextBlock::Create(*tbProps, *paraProps, *runProps, *ISessionMgr::GetActiveDgnModelP());
                
        if( textBlock.IsValid() )
        {
            textBlock->SetUserOrigin(Point);
            textBlock->SetOrientation(Matrix);
            textBlock->AppendText(WTxtString);
        }

        EditElementHandle textElm;
        TextBlockToElementResult textReturn = TextHandlerBase::CreateElement(textElm, NULL, *textBlock);
        
        if( TextBlockToElementResult::TEXTBLOCK_TO_ELEMENT_RESULT_Success == textReturn)
        {

Anybody can help me to locate my code bug?

Best,

[CONNECT VBA] CreateTextElement1 unknown error (80040c7f)

$
0
0

Why this part of code no longer works in CE and returns unknown error?

Dim teP As TextElement

Set teP = CreateTextElement1(Nothing, "", Point3dZero, Matrix3dIdentity)

How can i get the element information of an element which used for fence boundary?

$
0
0

hello,

my requirement is to make a fence from boundary of a shape element by clicking inside of the shape (not "on the shape") and get the element ID of that shape element for further process with MVBA.

many thanks, Vinoth

Viewing all 4331 articles
Browse latest View live