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

One change updates MicroStation.

$
0
0

We use a software called BMC Remedy to keep track of our inventory, it uses SQL database. We also use MicroStation to show where our equipment is on a floor plan. Is there away to link the two? Where when we change a location in Remedy it makes the change automatically in MicroStationc drawn floor plan.


[V8i C#] How to create custom property unit specification properly

$
0
0

Hi,

in MicroStation V8i (SELECTseries 3) using EC SDK API I create EC schema from scratch. The schema is stored in active DGN file and EC classes attached to elements. At the end of the process, the file will be exported to i-model format.

I need to add unit specification to my EC property definition. After some testing and research (because I have not found any example or documentation), I am able to do it both manually in Bentley Class Editor (but it will be not used in the workflow, because EC schema content can be slightly different for every processed model) and using C# code. Simplified code snippet is this:

IECSchema attributeSchema = UnitsSchemaCreator.UnitAttributesSchema;
IECClass attributeClass = attributeSchema.GetClass(UnitsConstants.UnitSpecification);
IECInstance attributeClassInstance = attributeClass.CreateInstance();

attributeClassInstance[UnitsConstants.DimensionName].StringValue = "L2";
attributeClassInstance[UnitsConstants.UnitName].StringValue = "DECIMETRE_SQUARED";
attributeClassInstance[UnitsConstants.KindOfQuantityName].StringValue = string.Empty;

ecProperty.SetCustomAttribute(attributeClassInstance);
parentECClass.Add(ecProperty);

My question is what is the best practice when I need to use engineering unit not available in standard EC unit definition (e.g. DECIMETRE_SQUARED or MILLIMETRE_CUBED). I guess there are these options:

  • Use the code "as is", but in such case, when opened in MicroStation, warning about missing unit is displayed (see this may related question).
  • To create and add the unit specification somehow programatically.
  • To create own unit supplement schema with required units upfront (I know all units I will possibly need during the conversion), import it into DGN file and to reference these specification in my schema somehow.

I prefer the first way, because it what works and I am not sure whether other two are possible and how to implement them. On the other hand I don't know what consequences missing unit specification has. The output format is i-model, so data will be accessed in read-only mode.

With regards,

  Jan

Glyph API ?

$
0
0

Ran across PLANSTUDIO SRL, authors of Progenio. They are also a Bentley Gold level channel partner and have been developing Progenio since 1995.

Looking at the way Progenio works, I noticed a lot of similarities with TopSolid Wood, another joinery / cabinetry package.

Both packages have workflows that are highly dependent on the user selecting faces or edges of either the reference or 'sketch' geometry (simple 3d blocks or shapes) or extruded or thickened solids.

In Progenio, when selected, the edges are highlighted in diferent colours both in Mstn's normal View windows; and also in the dialog box graphic. This gives critical cues to the user who will need to assign values or mods to each edge. There is also a directional or normal 'cone' glyph. I guess this gives the user an idea of how the dialog display graphic is oriented.

In TopSolid, there seems to be a lot more and precise use of on screen glyphs to help the user select and snap to faces or edges. This example looks at what TS calls a Driver Block. I think that this where the user hovers over and is offered up a volume or 'block' which serves to defined and feed a macro that subdivides the block into multiple drawers or other features. Conical glyphs are also used to help align and constrain faces.

Back in Progenio, there is a similar workflow where a cabinet section needs to be subdivided into drawings, but the process is more laborious, requiring the user to pick three points to in effect define an ACS system for the 'drawer macro' to work.

Comparing both packages, Progenio doesn't seem to be able to get deep enough into Mstn to provide a high level of UI ergonomics and productivity. Mstn has gyphs and markers for the Dynamic View Clip Volumes. Is that block of code available as an example in the SDK? Gold level partners like Progenio should be able to follow on with similar selling points / features almost immediately.

Some of the key features of the glyphs:

1. Able to be clicked on or recognised by the cursor: See the way the DV Clip Volume Cut direction can be flipped, when the user clicks on it. Another example is ABD's door swing direction glyph. Clicking on a gylph may also deselect something etc.

2. Glyphs or Grips should also allow the user to snap or move something accurately. Again, see the way DV Clip Volume or cut solids handles work. For a third party dev like Progenio, this will mean bi-directional updates with any linked values in their dialog boxes.

3. Parasolid information like vertex, edge and face index, normals, tangents etc should be available? See the way Grasshopper or Houdini can display the vertex or edge ID / index on screen. This is great for visuallising what the code is doing. This kind of helper tools would be normally done by your pro-coder, but hey I don't think Bentley has very many of these outside in their ecosystem. And these guys are probably hired in to fix or update stuff on an ad hoc or emergency basis. Why not just include something in the SDK to ease the process / adoption.

4. What about tools like ACS that are already part of Mstn? If Mstn's ACS tool has something to generate an ACS by snapping on to a face; can this be utilised by someone like Progenio? Can Progenio add their own info to the ACS widget.. eg drawing width, depth, height message or lables on screen instead of the usual XYZ?

5. Progenio's graphic in their dialog box: is this rendered and managed by tools provided by the Mstn SDK? Or is this all done using Microsoft tools? It would be good have some templates for those part-time devs or CAD Admins or in-house non-pro or cheap freshie intern coder types... to grease the wheels?

[connect c++] How to get/calculate text run's origin

$
0
0

Hi Experts,

I am using Connect C++ API to query TextBlock, Paragraph and Run's information. In order to make it easy to rendering in downstream application, I want get or calculate every run's origin, what's the recommended way to do this. About origin I only notice TextBlock has an origin and it's Justifaction related. Also I notice there is a TextString class can only accept TextElement and calculate it's origin (left bottom) and userOrigin, but none of them are related with run level. 

Thanks,

Danny

[V8i VBA]IPrimitiveCommandEvents_DataPoint & Windows 10 & MS SS3 (08.11.09.655)

$
0
0

I understand MS SS3 isnt certified for windows 10 however I have an odd problem with a VBA project which I am wondering if it could be down to the possibility of MS version and Windows 10. The VBA project allows me to place a large amount of data from an XLSX file as text elements into a DGN file. The machine I use in Windows 7 and MS SS4(08.11.09.829) and the project works flawlessly for me. When I run it on a colleagues machine running Windows 10 the following happens:

  • The UserForm displays,
  • I can browse and select the target XLSX file
  • Data is read into multiple arrays
  • I set custom text formatting settings/ scale data is to be inserted at/sort listboxes display certain data in the arrays etc...
  • However, when I press the CommandButton which triggers my class to create and insert the text, I step through the debugger to see what happens until the code completes and awaits a data point from the user (This is used as the origin point around which all of the array data is relatively inserted as text elements). The problem I am encountering is that my Data Point is not being registered. I still like to work with a manual tentative snap and I use that to snap to an element at the origin, after doing so, MS doesn't recognise that I have supplied a data point.

Does anyone know if this could be caused by an uncertified version for Windows 10?

[CONNECT MicroStationAPI] C++ Objects and Dialog Items

$
0
0

We write an app. that uses the MicroStationAPI  using C++.  If that app. has a user interface using MSDialog and dialog items then we must communicate via the Dialog Manager.  But the Dialog Manager requires us to publish global variables, which don't fit well with the idioms of object-oriented programming.

I designed an object based on variants.  The object encapsulates its own data and a pointer to a global variable.  This mechanism lets the object communicate with the MicroStation Dialog Manager yet conform to your C++ expectations.

How to change Text to Text Node with multiple lines

$
0
0

Hello,

I have many Text objects, each with a long text. I am writing a VBA code to reorganize each text  ("1234 Name" to "Name 1234"). My problem is that I  need "1234" and "Name"   on separate line. So I need to change each Text to a Text Node. I would like to keep location of my original Text. I did have a look at text2node, but it is not working for me. I am using Microstation CONNECT Update 5.  Thanks Sarka

[CONNECT C++] Named Group element as Item instance Host

$
0
0

Can I attach an Item Type instance to a NamedGroup element?


[CONNECT C++] mdlImage_updateIngrAttach is missing

$
0
0

How do I update the origin and extent in a CIT file in CONNECT Edition? We used mdlImage_updateIngrAttach in v8i, but this function is missing.

regards

Frode

[V8i VBA] VBA code no longer works after referencing a file

$
0
0

Hello

I have a VBA code that works without problems as long as I do not reference the DGN file. However, as soon as I refer this file the code no longer works. Even if I delete the reference again. The VBA code then no longer works in both files. I have no idea how to solve this problem. With the VBA code, the names of the feature cells are to be recognized, read out and counted.Can anyone help me? 

Option Explicit

Type CellInfo
Name As String
count As Long

End Type

Private Function GetIndex(cellName As String, cells() As CellInfo) As Long
    Dim i As Long

    For i = 0 To UBound(cells)
        If StrComp(cells(i).Name, cellName, vbTextCompare) = 0 Then
            GetIndex = i
            Exit Function
        End If
    Next i

    GetIndex = -1

End Function

Sub KernbohrungenZaehlen()
    Dim count As Long
    Dim ee As ElementEnumerator
    Dim oscan As ElementScanCriteria
    Dim cells() As CellInfo
    Dim i As Long
    Dim index As Long

    Set oscan = New ElementScanCriteria
    oscan.ExcludeAllTypes
    oscan.IncludeType msdElementTypeCellHeader

    Set ee = ActiveModelReference.GraphicalElementCache.Scan(oscan)
    While ee.MoveNext
        If count = 0 Then
            ReDim cells(count)
            cells(count).count = 1
            cells(count).Name = ee.Current.AsCellElement.Name
            count = count + 1
        Else
            index = GetIndex(ee.Current.AsCellElement.Name, cells)
                If index = -1 Then
                    ReDim Preserve cells(count)
                    cells(count).count = 1
                    cells(count).Name = ee.Current.AsCellElement.Name
                    count = count + 1
                Else
                    cells(index).count = cells(index).count + 1
                End If
        End If
    Wend
End Sub

Many Thanks

[CONNECT C++] What is the WIP in GetPrivateWipInstance?

$
0
0

Several methods documented in the MicroStationAPI include 'WIP', as in GetPrivateWipInstance() and GetSharedWipInstance().

What is 'WIP'?

[C# CONNECT] Display element as image

$
0
0

Hi,

I need to display an image of an element (a cell to be precise) in a form. I VBA there is element.GetPicture() but I cannot find something similar in .NET.

There are the ElementGraphicsProcessor and ElementGraphicsOutput but I cannot figure out if thats the way to go.

/Krister

[CE C#] Create sweep solid by line

$
0
0

Hi, I want to sweep a solid along a 3D alignment.

I find a method named DgnRuledSweepDetail.

But, this method need to input the curve vectors of the planes.

Now, I have a X-Z plane, how can I get the each curve vectors of the planes along the alignment? 

After making a query the composite surface elements remain at the DEFAULT level

$
0
0
the problem I have is that when entering elements that generate a composite surface like NodeBoundarie, PowerSupplyBoundary, Racks does not present any problem when entering them in Bentley Comms Geospatial, performs the post and the merge without problems, it is at the moment of returning to perform a query, those elements go to the "Default" level always and in the case of the Racks it is not possible to perform the rack elevation

PC preformance

$
0
0

I’m a document controller in my company and I have Microstation installed in my PC & ProjectWise in the server for documentation and Searching Plus other programs to support my work. We are in a process to change our PC’s as they are slow and for that, may I know the Ideal requirements for such workload?

1- Windows

2- Ram Size

3- Graphic Card . . . etc.

Thanks in advance.


C# CONNECT - GetCellInformationEnumerator crash

$
0
0

Hi,

I'm porting a .NET application from v8i to CONNECT. The application compiles without warnings or errors on CONNECT, but when I try to call the following method MicroStation CONNECT crashes:

BCOM.CellInformationEnumerator cellEnumerator = mainAddin.ComApp.GetCellInformationEnumerator(false, false);

The same line works fine in V8i.

Other calls to mainAddin.ComApp is working fine, for example mainAddin.ComApp.AttachCellLibrary(lib, BCOM.MsdConversionMode.Never); is working.

The minidump reports

1. 00710000 + eb000 ?No Ver Info ?GetModuleFileName failed with error 126 for 0000000000710000
2. 01550000 +e34000 ?No Ver Info ?GetModuleFileName failed with error 126 for 0000000001550000

Missing DLL's maybe? 

Regards,

Bjørn

[Connect C#] Getting dimension values

$
0
0

How does one retrieve the text\values from a dimension element using the DgnPlatform api?

I tried grabbing the TextBlocks, but all it returns is "*"

Thanks,

Maury

[CONNECT C++] CommandClass when creating an Item Type

$
0
0

My app., which includes a CommandTable, creates and deletes Item Type definitions (e.g. using ItemTypeLibrary::Create()).

Which MicroStation CommandClass (from Mstn/MdlApi/cmdclass.r.h) should I assign to a command that defines an Item Type?

trim shape mvba tool

$
0
0

Hi karthi,

I am ramakrishna jam sledger given link is not runnin that trim shape tool pls upload that link another one thing 2k tool you send me

Regards,

Ramakrishnan.N

Removing Features Using VBA

$
0
0

Hello,

I am trying to remove features from some linear forms in a DGN 3D-model using VBA, but I cannot figure out how to remove these features, I tried to suppress, and move the features but nothing occurs, any one has any idea , and thanks in advance

here is the code

Sub DeleteOpennings()

Dim ce As Element
Dim ee As ElementEnumerator

Dim flist As TFFeatureList
Dim formrecipe As TFFormRecipe

Dim tfrecipelist As New TFFormRecipeList

Set ee = ActiveModelReference.GetSelectedElements

While ee.MoveNext
    Set ce = ee.Current

wend

    tfrecipelist.InitFromElement ce
    Set flist = tfrecipelist.AsTFFormRecipe.GetFeatureList()
    flist.AsTFFeature.SetSuppressed (True)

End Sub

Viewing all 7260 articles
Browse latest View live


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