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

How do you guys go about vertically aligning an element of unknown height in a div?

$
0
0

I've always had to resort to using tables with valign, because I cannot ever figure out a good option in css. How do you guys do it?

Here's a use case. I have an image with a max height and width of 50px in a div that's 50px x 50px. The image will scale, so if it's not perfectly square, it will either be 50px wide or 50 px tall, with the other dimension proportional, so it still looks normal.

The problem is, when the image is not square and 50 px wide, I want it to be centered vertically, but the only way I ever can figure to do that is with a table.

I've tried vertical align with line heights set and all that jazz, but it never seems to work for me in css. Any ideas? Here's some sample html and css

Just remember that my image isn't always this width and height, that's dynamically set via back end code to keep the image proportional

<div class="badgeImage">
<img id="mainContent_ctl00_rptActiveAchBadges_ctl00_bnimgBadgeImage" src="someImage.png" style="height:42px;width:64px;">
</div>

<div class="badgeName">
<div title="Exam 00001" class="tooltip"><span title="">Exam 00001</span></div>
</div>


.badgeImage
{
height: 64px;
width: 64px;
text-align: center;

}
.badgeName
{
display: block;
margin-top: 5px;
}


V8i View Attributes Settings Macro for 2D Design Files

$
0
0

This macro will change the View Attributes settings for a 2D design file.
Copy and paste into your text editor, modify as needed.

'====================================================
'   Created by Carl Kastner
'   20180913
'   MicroStation V8i SS4 | Win 7
'====================================================

' Turns off/on (False/True) attributes on the View Attributes dialog.

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

'   Send a keyin that can be a command string
    MbeSendKeyin "MDL KEYIN BENTLEY.VIEWATTRIBUTESDIALOG,VAD VIEWATTRIBUTESDIALOG SETATTRIBUTE 0 ACSTriad True"

    MbeSendKeyin "MDL KEYIN BENTLEY.VIEWATTRIBUTESDIALOG,VAD VIEWATTRIBUTESDIALOG SETATTRIBUTE 0 Background False"

    MbeSendKeyin "MDL KEYIN BENTLEY.VIEWATTRIBUTESDIALOG,VAD VIEWATTRIBUTESDIALOG SETATTRIBUTE 0 BoundaryDisplay False"

    MbeSendKeyin "MDL KEYIN BENTLEY.VIEWATTRIBUTESDIALOG,VAD VIEWATTRIBUTESDIALOG SETATTRIBUTE 0 ClipVolume True"

    MbeSendKeyin "MDL KEYIN BENTLEY.VIEWATTRIBUTESDIALOG,VAD VIEWATTRIBUTESDIALOG SETATTRIBUTE 0 Constructions True"

    MbeSendKeyin "MDL KEYIN BENTLEY.VIEWATTRIBUTESDIALOG,VAD VIEWATTRIBUTESDIALOG SETATTRIBUTE 0 DefaultLighting False"

    MbeSendKeyin "MDL KEYIN BENTLEY.VIEWATTRIBUTESDIALOG,VAD VIEWATTRIBUTESDIALOG SETATTRIBUTE 0 Dimensions True"

    MbeSendKeyin "MDL KEYIN BENTLEY.VIEWATTRIBUTESDIALOG,VAD VIEWATTRIBUTESDIALOG SETATTRIBUTE 0 DataFields True"

    MbeSendKeyin "MDL KEYIN BENTLEY.VIEWATTRIBUTESDIALOG,VAD VIEWATTRIBUTESDIALOG SETATTRIBUTE 0 Displayset False"

    MbeSendKeyin "MDL KEYIN BENTLEY.VIEWATTRIBUTESDIALOG,VAD VIEWATTRIBUTESDIALOG SETATTRIBUTE 0 FastCells False"

    MbeSendKeyin "MDL KEYIN BENTLEY.VIEWATTRIBUTESDIALOG,VAD VIEWATTRIBUTESDIALOG SETATTRIBUTE 0 Fill True"

    MbeSendKeyin "MDL KEYIN BENTLEY.VIEWATTRIBUTESDIALOG,VAD VIEWATTRIBUTESDIALOG SETATTRIBUTE 0 Grid False"

    MbeSendKeyin "MDL KEYIN BENTLEY.VIEWATTRIBUTESDIALOG,VAD VIEWATTRIBUTESDIALOG SETATTRIBUTE 0 LevelOverrides False"

    MbeSendKeyin "MDL KEYIN BENTLEY.VIEWATTRIBUTESDIALOG,VAD VIEWATTRIBUTESDIALOG SETATTRIBUTE 0 LinesStyles True"

    MbeSendKeyin "MDL KEYIN BENTLEY.VIEWATTRIBUTESDIALOG,VAD VIEWATTRIBUTESDIALOG SETATTRIBUTE 0 LineWeights True"

    MbeSendKeyin "MDL KEYIN BENTLEY.VIEWATTRIBUTESDIALOG,VAD VIEWATTRIBUTESDIALOG SETHUDMARKERVISIBILITY ON 0 ""\"""

    MbeSendKeyin "MDL KEYIN BENTLEY.VIEWATTRIBUTESDIALOG,VAD VIEWATTRIBUTESDIALOG SETATTRIBUTE 0 Patterns True"

    MbeSendKeyin "MDL KEYIN BENTLEY.VIEWATTRIBUTESDIALOG,VAD VIEWATTRIBUTESDIALOG SETATTRIBUTE 0 Tags True"

    MbeSendKeyin "MDL KEYIN BENTLEY.VIEWATTRIBUTESDIALOG,VAD VIEWATTRIBUTESDIALOG SETATTRIBUTE 0 Text True"

    MbeSendKeyin "MDL KEYIN BENTLEY.VIEWATTRIBUTESDIALOG,VAD VIEWATTRIBUTESDIALOG SETATTRIBUTE 0 TextNodes False"

    MbeSendKeyin "MDL KEYIN BENTLEY.VIEWATTRIBUTESDIALOG,VAD VIEWATTRIBUTESDIALOG SETATTRIBUTE 0 Transparency True"
End Sub

[CONNECT C#] Get list of annotation scales in file

$
0
0

I'm making a c# wpf addon for microstation. I want to get the list of available Annotation Scales. I found how to get the current scale. but cant seem to find how to get the list of scales.

heres the code for getting the currently set scale.

using BD = Bentley.DgnPlatformNET;


BD.DgnModel activeModel = Bentley.MstnPlatformNET.Session.Instance.GetActiveDgnModel();
BD.ModelInfo activeModelInfo = activeModel.GetModelInfo();
double curScale =  activeModelInfo.AnnotationScaleFactor;

I tried looking through the help docs and cant seem to find this one.

thanks

JD

Help with creating Centroid point for Closed area!

$
0
0

Help with creating Centroid point for Closed area (area created by line, linestring). My centroid point creating function and function shape.centroid get the similar results, and i use NetTopology Suite also for the same result. But i want result as attached figure.Help me, please!

 

[Connect U10 Documentation] Where is RibbonDefinitions.xsd?

$
0
0

In the MicroStationAPI.chm documentation there is a reference to miscdev\mstnappdata\workspace\System\GUI\Ribbon\RibbonDefinitions.xsd located at Modules | Ribbon | Ribbon Bar interface | Introduction in the help file. Where is this file located? I was trying to locate the parent(s) folders to miscdev to no avail.

Best Regards

Marty 

[CONNECT C++] Namespace problem with ReachableElementOptions

$
0
0

I want to iterate elements in a DGN model.  This looks like a good candidate...

USING_NAMESPACE_BENTLEY_DGNPLATFORM;
DgnModelRefR model = *ISessionMgr::GetActiveDgnModelP (); ReachableElementOptionsPtr options = ReachableElementOptions::CreateOptions (); // The compiler complains here
ReachableElementOptionsP pOptions = options;
model.GetReachableElements (pOptions);

However, the compiler doesn't like that.  It tells me:

error C2440: 'initializing': cannot convert from 'Bentley::DgnPlatform::ReachableElementOptionsPtr' to 'Bentley::ReachableElementOptionsP'

I need a ReachableElementOptionsP to pass to DgnModelRef.GetReachableElements ().  There's a  namespace problem with the scope of ReachableElementOptionsPtr and ReachableElementOptionsP.

[CONNECT C++] ReachableElementOptions - options which will be used for choosing which modelRefs to consider

$
0
0

Class ReachableElementOptions is used with DgnModelRef.GetReachableElements (ReachableElementOptionsP) to constrain a search for elements.

I'm puzzled by method GetModelRefOptions, described as Get the options which will be used for choosing which modelRefs to consider.  There's no corresponding setter, so how does one specify which modelRefs to consider?

There is no example of its use.

[CONNECT C++] Notes about Iterators

$
0
0

I've written some notes about various iterators in the MicroStationAPI.  I find it useful to have a summary that provides an alternative to the documentation.

Iterator Diagram

There are several web pages about different sorts of iteration.  I've referenced the legacy MDL equivalent so you can see how to do things the CONNECT way compared to the historic MDL way.


AddTubeMesh for a line wiht 3 segment as below did not return the desired mesh?

$
0
0

Hi expert,

  I have a line as below, (i am runing with Microstation CE)

 

it is just one line with 3 segment, and i want to get a mesh to represent the line, using api

 .......................

IPolyfaceConstructionPtr pPolygonFace = IPolyfaceConstruction::Create(*pFacetOptionsPtr.get());

MSBsplineCurve bspline;

curveVector->ToBsplineCurve(bspline);

pPolygonFace->AddTubeMesh(bsplineCurve, dRadius, 12, 12);

PolyfaceHeaderPtr pPolyMesh = pPolygonFace->GetClientMeshPtr();

.....................

with that api, i can get the mesh from the Line, but in the corner, the mesh seems messy,

I just need a mesh(some cylinder face) to represent the line,  the result mesh should looks extacly as the orignal Line, have the same radius for all 3 segment.

do u know how i can get an expected mesh for the Line (each segment should looks like a same radius cylinder face, i think)?

thanks,

Rick

MicroStation Connect C# Place cell as Annotation Cell

$
0
0

I am using Microstation Connect, version 10.09.01.01.

I have created .NET Addin in which functionality to write a cell in the active model.

We did the following:

1) The cell comes from a cell library (DgnModel cellModel = LoadRootModelById()).

2) We get the ModelInfo object (cellModel.GetModelInfo()).

3) From the cellModel we get the components from that cell (cellModel.GetElements()).  

4) The elements where cloned using ElementCopyContext.

5) We create the cell element: CellHeaderElement cellElement = new CellHeaderElement(destModel, cellname, snapOrigin, orientation, cellInfo.Components);

6) The cell is written into active model and everything seems ok.

The cell element should be placed as Annotation Cell, property IsAnnotation should be True, but it doesnot.

I have seen some questions about this subject but so far I didnot manage to get the cell element written into active model as Annotation Cell. 

Can someone help me on this topic?

Thanks.

 

[CONNECT] Create Normal Cell

$
0
0

The MicroStationAPI and the DgnPlatformNet have a CreateSharedCellElement() method (as of Update 10).

Why isn't there a similar method for normal cells?

Please,help me find Element ID from file position!

$
0
0

I'm using MicroStation V8.5, and using programming language Vb.net. I had file Pos of element that exports from Microstation V.7. Because file Pos V.7 is different from file Pos V.8, i want to find Element ID from that file Pos to get Element in Microstation V.8. Please, help me (can by macro....).

What reference to add to VS2013 project to resolve MstnPlatform and MstnPlatformNET ?

$
0
0

Hi there,

Win10, MicroStation Connect Update 10.

I would like to introduce myself to some C# .NET programming for MicoStation.

Found .......\MicroStationCONNECTSDK\examples\Annotations\DescribeElementExample

I have Visual Studio 2013. As a first experience, trying to open and build DescribeElementExample.sln 

Some missing references in the project I was able to resolve by referencing dlls in the MicroStation tree, but I seem to be unable to find which dlls to reference for MstnPlatform and MstnPlatformNET 

Anyone an idea? (The red underlined texts below are unresolved; there are no missing references (with the yellow triangles) in the project).

Thanks, Jan Willem

using Bentley.DgnPlatformNET;
using Bentley.MstnPlatform;
using System.Windows.Forms;

namespace DescribeElementExample
{
/*=================================================================================**//**
* @bsiclass Bentley Systems
+===============+===============+===============+===============+===============+======*/
[Bentley.MstnPlatformNET.AddInAttribute(MdlTaskID = "DescribeElementExample")]
public sealed class DescribeElementExample : Bentley.MstnPlatformNET.AddIn
{
private static DescribeElementExample s_describeElementAddin = null;

[CE C#] 請問中文屬性名稱問題?

$
0
0

您好,

透過 PropertyHandler.GetAccessStrings();所取得的中文屬性名稱,

為何顯示如下?   __x7BA1____x7DDA____x578B____x614B__   

但是英文名稱是Ok的, 如何解析還原為中文字

謝謝

Connect C# template for Visual Studio2013

$
0
0

Hi,

Microstation Connect Edition update 8(version 10.08.00.37) and SDK is installed and Visual Studio 2013 is already exist. But When I try to create a new project by using Visual Studio2013, under 'Templates' Bentley for C# is missing. How to resolve this?


EC C# ,How to attach item type to element?

$
0
0

HI,

EC C# ,How to attach item type to element?

[Microstation V8i] Declaring MDL Functions in VBA

$
0
0

Hi all,

I'm trying to use the MDL functions within VBA so I've tried starting with something simple.

Public Sub MdlIdTest()
    Dim element As element
    Dim elementId As DLong
    elementId.Low = 620
    Set element = ActiveModelReference.GetElementByID(elementId)
    Debug.Print element.ID.Low
    Debug.Print mdlElement_getID(element.MdlElementRef).Low
End Sub

Output:

620
2208

Any ideas as to what's going wrong?

Kind Regards,

Mike

[Microstation V8i] MDL Mesh Functions in VBA

$
0
0

Hi All,

Can anyone give me an example of how to use the MDL mesh function mdlMesh_getPolyfaceArraysDirect.

I'm struggling to understand how to pass the int and point3d arrays into the VBA decleration as Longs.

Declare Function mdlMesh_getPolyfaceArraysDirect Lib "stdbspline.dll" ( ByVal pMeshHeaderED As Long , ByVal pIndices As Long , ByVal pXYZ As Long , ByRef pNumIndexPerFace As Long , ByRef pNumFace As Long ) As Long

Return Value

TypeDescription
StatusInt SUCCESS if the desired output is successfully returned

Parameters

TypeNameModeDescription
MSElementDescr const* pMeshHeaderEDINtop of descriptor tree containing the mesh.
EmbeddedIntArray* pIndicesOUTpolyface index array.
EmbeddedDPoint3dArray* pXYZOUTvertex coordinate array (3D points).
int* pNumIndexPerFaceOUTmax number of indices/vertices per face (= 1 if variable-size face loops)
int* pNumFaceOUTnumber of faces (#entries in index array if variable-size face loops).

    Dim success As Long
    Dim element As element
    Dim indicies() As Long
    Dim verticies() As Point3d
    Dim numOfIndicies As Long
    Dim numOfFaces As Long
    success = mdlMesh_getPolyfaceArraysDirect(element.MdlElementDescrP(False), indicies, verticies, numOfIndicies, numOfFaces)

Kind Regards,

Mike

[CONNECT C++] mdlLineStyle_numberFromName crashes app when set in MS_DGNAPPS

$
0
0

We have an app that chrashes MicroStation CONNECT Edition when run as MS_DGNAPPS. Is this a known issue? 

regards

Frode Tørresdal

[CONNECT C++] How do I prevent an Item Type property from being edited in the Element Property dialog?

$
0
0

My app. attaches an Item Type instance to an element.  Subsequently, a user may inspect the element using the Element Properties tool...

Element Properties

Some Item Type properties are calculated fields (circled in red above). They derive from element properties.  However, a user can apparently edit those values in the Element Properties dialog.  Can I programmatically set some attribute of an Item Type property that makes it non-editable?  That is, it becomes greyed-out in the Element Properties dialog?

Viewing all 4331 articles
Browse latest View live


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