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

MVBA SATOUT dialog box access

$
0
0

I have a MVBA macro,  to automate ACIS SAT file creation from model ...

my macro works well in Microstation Vi8 for years ... now I want it to run on Microstation Connect ... unfortunately it fails ... seems it can not acces file name command ... sample below

Could somebody tell whats wrong or different with Microstation CONNECT MVBA?

Implements IModalDialogEvents
Private Sub IModalDialogEvents_OnDialogClosed(ByVal DialogBoxName As String, ByVal DialogResult As MsdDialogBoxResult)
End Sub
Private Sub IModalDialogEvents_OnDialogOpened(ByVal DialogBoxName As String, DialogResult As MsdDialogBoxResult)
Dim FileName As String
Dim FileDir As String
Get #1, 1, FileName
Get #1, 2, FileDir
Put #1, 7, "es i te"

    If DialogBoxName = "Export ACIS SAT File" Then
        CadInputQueue.SendKeyin "MDL COMMAND MGDSHOOK,fileList_setFilterCmd *.sat"
        CadInputQueue.SendKeyin "MDL COMMAND MGDSHOOK,fileList_setDirectoryCmd" & FileDir
        CadInputQueue.SendKeyin "MDL COMMAND MGDSHOOK,fileList_setFileNameCmd" & FileName & ".sat"
    '   Remove the following line to let the user close the dialog box.
        DialogResult = msdDialogBoxResultOK
    End If  ' Export ACIS SAT File
End Sub

[Microstation V8i Select series 3, C++] mdlKISolid_faceToElement API crash

$
0
0

Hi All,

I am trying to use the below MDL API to get the smart model graphic data. I am facing random crash in debug mode while calling mdlKISolid_faceToElement API.

 

If i am trying in release mode, I am not getting the crash but it throws the exception "Access violation reading location 0x00000000" hence not getting the element body from faces. And this is a random behavior each time I am getting exception for different faces.

I have attached the mini dump and exception log, any help on this why I am getting this crash.

communities.bentley.com/.../6445.Dump.zip

Thanks & Regards,

Bhargava

 

[CONNECT] Dialog Items and CommandNumber and CommandSource

$
0
0

In the pre-CONNECT days it was possible to provide a CommandNumber and a CommandSource to an MDL DialogItem. For example:

DItem_PushButtonXRsc PUSHBUTTONID_Text= 
{ 
	DEFAULT_BUTTON, NOHELP, MHELP, 
	HOOKITEMID_PlaceTextOrNote, NOARG, CMD_PLACE_TEXT, MCMD, Icon, ICONID_PlaceText, "", "Place\nText"  
}   
	extendedAttributes
    {{
    {EXTATTR_FLYTEXT, "Place Text"},
    {EXTATTR_BALLOON, "Place Text"},
    }};

So when the button was pressed, the "Place Text" tool started. I'm trying to do a similar thing in CONNECT. First, it seems some of the command numbers no longer exist in cmdlist.r.h. I've looked at the ribbon definition(s) and have determined that the tool I want is "TextTools.PlaceText". I know I can key-in "runxcommand texttools.placetext" to fire off the tool. Can that same effect be achieved using a dialog item? How would the CommandNumber and CommandSource be coded? Do I have to pass in a mdlInput_sendKeyin() string of "runxcommand texttools.placetext" via a Hook Function?

Bruce

AECOsim (SS6) VBA - Can I Use a Cell Element as a Line Element?

$
0
0

Hello All, I'm trying to create a primitive gusset plate routine in VBA to run in AECOsim Building Designer (SS6). I want the VBA routine to draw a 4'x4' box at the start and end of each element (line). Lines in ABD for structural members are actually cells, and as a result, I can't figure out how to get coordinates for the start and endpoint of my "lines". I can only use .StartPoint and .EndPoint when using .AsLineElement, but lines in ABD are .IsCellElement, so I can only use .Origin (I think). Is there any way to get a cell element to use the .AsLineElement callout, or maybe somehow trace a temporary line over the cell to use it's start and end points? I have code that works when I draw simple lines, so I know I'm on the right track. I don't have a lot of experience with VBA and I've been reading the forums, help menu, and google searches for two days, but I just can't work past this. I tried to copy code, but the site marked it as spam. Thanks for any help.

IElementGraphicsProcessor (V8i) _ProduceGPAs vs. _ProduceFacets

$
0
0

Is it possible to configure the GraphicsProcessor to calculate facetSets first and GPAs second if the element could'nt be faceted?

Tom

activate transparency for all my raster loaded

$
0
0

Hello,

How I can activate transparency for all raster loaded ?

I mean instead of doing that for each raster tile I would like to set it on for all my raster (background color is the same).

thanks for your tips.

antoine

how to avoid starting MDL applications after terminating MircoStation by closing the main window Alt+F4

$
0
0

Hello,

when closing the main window of the MicroStation Connect program, our MDL application gets informed by the unload-function (mdlSystem_setFunction(SYSTEM_UNLOAD_PROGRAM,...) and the exit design file function mdlSystem_setFunction(SYSTEM_EXIT_DESIGN_FILE_STATE,... Now we close all dialogs, terminate the ribbons, free all memory, but after restarting MicroStation Connect our application gets startet by MicroStation automatically. In V8i and all older MicroStation Versions our application was terminated. Perhaps this behaviour is useful for some users - but for our customers ist not sensefull.

Is there a MicroStation variable to avoid starting MDLs automatically after closing MicroStation by closing the window (Alt+F4) ?

Kind regards,

Willi Spiegel

VBA ABD(SS6) How to Get Start Point and End Point of Cell Element?

$
0
0

Hello All, I'm trying to create a primitive gusset plate routine in VBA to run in AECOsim Building Designer (SS6). I want the VBA routine to draw a 4'x4' box at the start and end of each element (line). Lines in ABD for structural members are actually cells, and as a result, I can't figure out how to get coordinates for the start and endpoint of my "lines". I can only use .StartPoint and .EndPoint when using .AsLineElement, but lines in ABD are .IsCellElement, so I can only use .Origin (I think). Is there any way to get a cell element to use the .AsLineElement callout, or maybe somehow trace a temporary line over the cell to use it's start and end points? I have code that works when I draw simple lines, so I know I'm on the right track. I don't have a lot of experience with VBA and I've been reading the forums, help menu, and google searches for two days, but I just can't work past this. Thanks for any help.

Sub GussetPlates()'Scan For Horizontal Bracing
Dim StartPoint As Point3d
Dim Point As Point3d, Point2 As Point3d

Dim myCounter As Integer
Dim myElementEnumerator As ElementEnumerator
Dim myScanCriteria As New ElementScanCriteria
Dim myElement As Element

Dim myGussPL As Level
Dim myHB As Level
Dim myVB As Level
Set myHB = ActiveDesignFile.Levels("S-STL-HB")
Set myVB = ActiveDesignFile.Levels("S-STL-VB")
Set myGussPL = ActiveDesignFile.Levels("S-STL-PLAT-GUSS")

Dim myPoints As Point3d
Dim myLine As LineElement
Dim myEndPt As Variant
Dim myStartPt As Variant
Dim myRange As Range3d

myScanCriteria.ExcludeNonGraphical
myScanCriteria.ExcludeAllLevels
myScanCriteria.IncludeLevel myHB


Set myElementEnumerator = ActiveModelReference.Scan(myScanCriteria)
myElementEnumerator.Reset

While myElementEnumerator.MoveNext
    Set myElement = myElementEnumerator.Current
        If myElement.IsCellElement Then
            ActiveSettings.Level = myGussPL
                 
            
            '''THIS IS WHERE I'M STUCK'''
            myStartPt = myElement.AsLineElement.StartPoint
            myEndPt = myElement.AsLineElement.EndPoint
        CadInputQueue.SendCommand "PLACE SMARTLINE"'Coordinates are in master units
        StartPoint.X = myStartPt.X
        StartPoint.Y = myStartPt.Y
        StartPoint.Z = myStartPt.Z'Send a data point to the current command
        Point.X = StartPoint.X
        Point.Y = StartPoint.Y
        Point.Z = StartPoint.Z
        CadInputQueue.SendDataPoint Point, 1'Send a data point to the current command
        Point.X = StartPoint.X + 4
        Point.Y = StartPoint.Y + 0
        Point.Z = StartPoint.Z + 0
        CadInputQueue.SendDataPoint Point, 1'Send a data point to the current command
        Point.X = StartPoint.X + 4
        Point.Y = StartPoint.Y + 4
        Point.Z = StartPoint.Z + 0
        CadInputQueue.SendDataPoint Point, 1'Send a data point to the current command
        Point.X = StartPoint.X + 0
        Point.Y = StartPoint.Y + 4
        Point.Z = StartPoint.Z + 0
        CadInputQueue.SendDataPoint Point, 1'Send a data point to the current command
        Point.X = StartPoint.X + 0
        Point.Y = StartPoint.Y + 0
        Point.Z = StartPoint.Z + 0
        CadInputQueue.SendDataPoint Point, 1
        CommandState.StartDefaultCommand
       CadInputQueue.SendCommand "PLACE SMARTLINE"'Coordinates are in master units
        StartPoint.X = myEndPt.X
        StartPoint.Y = myEndPt.Y
        StartPoint.Z = myEndPt.Z'Send a data point to the current command
        Point.X = StartPoint.X
        Point.Y = StartPoint.Y
        Point.Z = StartPoint.Z
        CadInputQueue.SendDataPoint Point, 1'Send a data point to the current command
        Point.X = StartPoint.X + 4
        Point.Y = StartPoint.Y + 0
        Point.Z = StartPoint.Z + 0
        CadInputQueue.SendDataPoint Point, 1'Send a data point to the current command
        Point.X = StartPoint.X + 4
        Point.Y = StartPoint.Y + 4
        Point.Z = StartPoint.Z + 0
        CadInputQueue.SendDataPoint Point, 1'Send a data point to the current command
        Point.X = StartPoint.X + 0
        Point.Y = StartPoint.Y + 4
        Point.Z = StartPoint.Z + 0
        CadInputQueue.SendDataPoint Point, 1'Send a data point to the current command
        Point.X = StartPoint.X + 0
        Point.Y = StartPoint.Y + 0
        Point.Z = StartPoint.Z + 0
        CadInputQueue.SendDataPoint Point, 1
        CommandState.StartDefaultCommand
        End If
Wend

End Sub

PowerDraft v8i has 2 issues.

$
0
0

Upon opening a drawing, there is a black box text message: : “Warning: Fault exception set to ‘none’”. Then after working in the drawing, after no particular action, the program freezes. There is the typical Windows "rotating circle". The only solution is to ctrl-alt-del and exit the program. If trying to open the drawing again, it says can only open as "read only". So, have to ctrl-alt-del and sign out of the windows desktop and sign in again. I have started a Bentley Service Request, but have not been getting any updated suggestions from the tech support person. {SrvReqNo:[7000851353]. Still looking for some kind of help for these issues.

Paul Jacobson

pjacobson@woh.rr.com

[V8i C# Addin] VS2017 Community element properties not displayed, showing up as {System._ComObject}

$
0
0

Good day all, 

I haven't found a similar question to mine, so i decided to write one.

I am using VS 2017 Community Edition, version 15.9.4 and i used the InnovoCAD v8i C# Template as published on the VS Marketplace.

The problem I have is that when I debug in an MVBA project, I can see all the properties of an element, but when I do the same in C# using VS2017, it displays {System._ComObject}.  

In C#, it will select and count all the Items I need, and highlight them, as is required in the code, but I dot have access to any of the Element properties, even if the program uses some of the properties to determine which items to select.

For instance the procedure I have:

1. it checks whether an element is a cell

2. determines cellname to search for among the cells

3. if cellname matches requirements, cell is selected.

Below is the C# Code of the procedure.

public static void selectNormalCells(string cellType)
{
	BCOM.Element oElem;
	BCOM.Fence oFence;
	BCOM.ElementEnumerator oEnum;
	string cellName;
	Program.MSApp.ActiveModelReference.UnselectAllElements();
	oFence = Program.MSApp.ActiveDesignFile.Fence;
	oEnum = oFence.GetContents();
	//Determine MicroStation Cellname from combobox selected text
	switch (cellType)
	{
		case "LV Stays":
			{
				cellName = "001";
				break;
			}
		case "LV Struts":
			{
				cellName = "002";
				break;
			}
		case "MV Stays":
			{
				cellName = "003";
				break;
			}
		case "MV Struts":
			{
				cellName = "004";
				break;
			}
		case "LV Poles":
			{
				cellName = "009";
				break;
			}
		case "MV Poles":
			{
				cellName = "010";
				break;
			}
		case "MVLV Poles":
			{
				cellName = "011";
				break;
			}
		case "LV Flying Stays":
			{
				cellName = "015";
				break;
			}
		case "MV Flying Stays":
			{
				cellName = "017";
				break;
			}
		case "TRFRS":
			{
				cellName = "TXTCS";
				break;
			}
		default:
			{
				cellName = "000";
				break;
			}
	}
	//Iterate through all elements and select only the cell elements named 'CellName.

	while (oEnum.MoveNext())
	{
		oElem = oEnum.Current;
		if ((oElem.Type == BCOM.MsdElementType.CellHeader))
		{
			if ((oElem.AsCellElement().Name == cellName))
			{
				oElem.Redraw(BCOM.MsdDrawingMode.Hilite);
				Program.MSApp.ActiveModelReference.SelectElement(oElem);
			}
		}
	}
}

 

Below is a screenshot of the locals window in VS2017 Community.

Sample Screenshot 01

Below is the VBA code in mvba project,

Sub selectNormalCells(ByVal CellType As String)
    Dim oElem As Element
    Dim ofence As Fence
    Dim oEnum As ElementEnumerator
    Dim CellName As String
    ActiveModelReference.UnselectAllElements
    Set ofence = ActiveDesignFile.Fence
    Set oEnum = ofence.GetContents'Determine MicroStation Cellname from combobox selected text
    Select Case CellType
        Case "LV Stays"
            CellName = "001"
        Case "LV Struts"
            CellName = "002"
        Case "MV Stays"
            CellName = "003"
        Case "MV Struts"
            CellName = "004"
        Case "LV Poles"
            CellName = "009"
        Case "MV Poles"
            CellName = "010"
        Case "MVLV Poles"
            CellName = "011"
        Case "LV Flying Stays"
            CellName = "015"
        Case "MV Flying Stays"
            CellName = "017"
        Case "TRFRS"
            CellName = "TXTCS"
        Case Else
            CellName = "000"
    End Select'Iterate through all elements and select only the cell elements named 'CellName.
    Do While oEnum.MoveNext
        Set oElem = oEnum.Current
        If (oElem.type = msdElementTypeCellHeader) Then
            If (oElem.AsCellElement.Name = CellName) Then
                oElem.Redraw msdDrawingModeHilite
                ActiveModelReference.SelectElement oElem
            End If
        End If
    Loop
End Sub

And a screenshot of the locals debug section in MVBA

I can clearly see items and properties of the elements in VBA, but not in the VS2017.

Is there a variable i have not set or some setup step  I omitted?

Furthermore, the function in both instances works, and selects the appropriate cells, but in VS2017 I dont have access to the properties. I only see {System._ComObject}.

Kindly assist. I can send further information by request.

Regards, 

Greg M

System details:

Microsoft Windows 10, 64-bit

MicroStation v8i (SS4), 08.11.09.832

8GB RAM

[CONNECT C++] Problem referencing NativeWinMFC.lib and building in Debug

$
0
0

Hi Everyone,

Has anyone seen this problem in their Native C++ Project when referencing NativeWinMFC.lib and building their project in DEBUG? Everything builds fine in RELEASE for me. Just not in DEBUG.


Thank you,
Rich

Mstn CE, Update 11, VBA--Tentative snap not working

$
0
0

Hi,

I have a routine that works in Microstation V8i SS3, which does not work in Mstn CE, Update 11:

Function GetIntersectionPoint(Point1 As Point3d, Point2 As Point3d) As Point3d
    CommandState.StartDefaultCommand
    CadInputQueue.SendKeyin "snap intersection"
    CadInputQueue.SendTentativePoint Point1, 1
    CadInputQueue.SendTentativePoint Point2, 1
    CadInputQueue.SendAdjustedDataPoint Point3dZero
    GetIntersectionPoint = CursorInformation.DataPointAdjusted
End Function

This function basically has Microstation do and intersection snap with two elements (defined by Point1 & Point 2) and returns the found point.

Is there a better way of doing this?

--Thanks,
--Robert

RE: [MicroStation Programming Forum] PowerDraft v8i has 2 issues.

$
0
0
Thanks for your input. I am having another Windows problem that I have to first get fixed. If not, I may get another computer. Whenever the machine is restarted, it opens to a black screen; having to manually turn off and on for several minutes until it logs on properly. Here are the specs of my system:
Windows 10 Pro
Processor AMD A10-8700P Radeon R6, 1.8 GHz
16 GB RAM
64 bit OS, Dell Inspiron
Does that seem good for PowerDraft?
If getting a new computer would Windows 10 Home, 32 bit be workable?
Thanks,
Paul Jacobson
From: Robert Hook <bounce-D147C1E1-1607-4727-B6C7-D38CADFFAA27@communities.bentley.com>
Sent: Thursday, December 20, 2018 2:44 PM
To: MicroStationProgramming@communities.bentley.com
Subject: RE: [MicroStation Programming Forum] PowerDraft v8i has 2 issues.
 
 

Hi paul jacobson,

Jan is correct that product hangs and crashes (unless you are the programmer) should be placed in the product forum directly.  I will move this thread over to the MicroStation Forum.  Also, thank you for providing the information you did. Your SR# was updated with some notes that development reviewed the issue but did not see anything very suspicious.  Here are some things that I suggest based on my observations of the 2nd dump file you provided.

Please try these in order and 1 change at a time to help us determine if the issue can be resolved and by exactly which step if corrected in the process.

  1. You are running PowerDraft 08.11.9.829 (32-bit) on Windows 10 (32-bit)
  2. STEP: Right-click on your PowerDraft icon/shortcut and try (once) to Run As Administrator and see if that resolves the issue
  3. STEP: If installed, see if you can successfully open - Windows Start > CONNECTTION Client > CONNECTION Client (app)
  4. Unfortunately the hang dump did not allow me to inspect/analyze the WaitForMultipleObjects object in contention to state exactly what application (object) is not functioning properly.
  5. A Quick review of the Product and OS dll versions appear to be sound
  6. 3rd party application impacts. I noticed two customizations below loaded in our application address space. If possible: (update, configure, and temporarily disable/uninstall) each in the order listed and reboot if/when prompted to do so.  Then test after each step to determine if the issue is resolved at a specific step.  NOTE: For "configure" check for any application settings that may mention any of these words: "Shell/Explorer Integration/Extensions" to see if they can be disabled.  If not, then "uninstall" (temporarily) each in order listed and test to see which step may correct the issue.
    1. 01.00.26.00 C:\Program Files (x86)\Dropbox\Client\DropboxExt.26.0.dll
    2. 18.65.329.02 C:\Users\<YOURUSERNAME>\AppData\Local\Microsoft\OneDrive\18.065.0329.0002\FileSyncShell.dll

Please keep us posted which if any steps may help, otherwise please work with the analyst assigned to your SR or post here as needed.

HTH,
Bob

View online

 

You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

Flag this post as spam/abuse.

 

can anybody help me in create a macro for placing solid sphere at active point (set by user) at varying co-ordinates?

$
0
0

I have a recorded the macro for fixed co-ordintates. I want to place sphere at active point set by user at various co-ordinates which will be variable. Please see the attached file for vba code for fixed co-ordinates.

Please see the attached video in the ppt file.  Can anybody help in creating macro for placing sphere at varying co-ordinates.

communities.bentley.com/.../Presentation1-_2800_1_2900_.pptx

Equivalent AssembleComplexStringsAndShapes (MicroStation V8i Interop) in Connect C#

$
0
0

In V8i there is a method AssembleComplexStringsAndShapes() ('old' api, InteroOp), to properly oriented the components.

Does someone know if there is an equivalent function in MicroStation Connect C#, new api?

Thanks


[C++ CONNECT] Extract points from POD file

$
0
0

Hi all!

I have POD-file. I need get points from this POD-file.

How can I read this file and extract points?

Facing an error in microstation v8i selectseries4 while defining actor path for animating a man model to a defined path.

$
0
0

I am using microstation v8i ss4. I have created keyframes for animating (making the man model walk). After setting the keyframes, when I am defining the Actor path and orientation it is showing the following error. Can anybody help me out?

constrain ModifyVertex to z axis only

$
0
0

Hi  

I am trying to create a program in VBA to Modify Vertex elevation only if needed, so far i have created a program to edit the vertex but i am unable to constrain it to only z axis.

I am working with connect edition update 10

Copy folder using variables

$
0
0

MicroStation CE U11

I am trying to do a few things, create a folder if it does not exist, and then copy a folder from one location to another using variables that define the source folder and the location that the source folder is to be placed in. So far I am successful in creating the folder but for the copy folder part, it errors out. Any ideas? When I place the full path in the to and from it works, but when I try to use variables, it errors.

Below is an example of what I am thinking. The goal is to use variables available from the configuration in the event the workspace resources are different for different clients. No hard paths like "C:\folder\".

Sub BVEClashDetectionSetup()
    Dim LOCATIONA As String
    Dim LOCATIONC As String
    Dim strDir1 As String
    Dim objFSO As Object
   
    ' Define locations for resources
    LOCATIONA = ActiveWorkspace.ConfigurationVariableValue("LOCATIONA") 'from location
    USTNCE_Root = ActiveWorkspace.ConfigurationVariableValue("_USTN_HOMEROOT") 'assist to create to location
   
    ' Create directory if does not exist
    strDir1 = USTNCE_Root & "newfolder" 'to location
    If Dir(strDir1, vbDirectory) = "" Then
        MkDir strDir1
    ' Copy resources from workspace to local
        Set objFSO = CreateObject("Scripting.FileSystemObject")
        'objFSO.copyFolder "C:\Path\to\source\folder", "C:\Path\to\destination\folder"
        objFSO.CopyFolder LOCATIONA, strDir1
    Else
    ' Error checking
        ShowMessage "FolderA Already Exists!!!"
    End If
 
End Sub

Thanks ahead of time!!!

Mark W.

[CONNECT C++] AccuDrawDemo magic numbers

$
0
0

SDK example AccuDrawDemo includes file adrwdmt.r.  That file is compiled by the Bentley resource compiler (i.e. it's not a C++ source file).  It contains some arcane data structures and some unexplained magic numbers …

#include <Mstn\MicroStation.r.h>
#include <RmgrTools\Tools\datadef.r.h>
#include <RmgrTools\Tools\cexprrsc.r.h>

// struct adrwdemoinfo is defined in adrwdemo.h
CexprName 0 = {"adrwdemoinfo"};
CexprName 1 = {"showAxes"};
CexprName 2 = {"useCPlane"};

CexprNamedStructures 1 =
    {{
    {0,  	0,	218519819},	/*  adrwdemoinfo  */
    }};

/*    struct adrwdemoinfo    */
CexprType 0 = {18,	8,	0,	0,	0};
CexprType 1 = {4,	4,	0,	65535,	0};

CexprMemberList 0 =
    {{
    {0x1, 	0,	1, 	0x2c006df5}, 	/*  showAxes  */
    {0x1, 	4,	2, 	0x7600db45}, 	/*  useCPlane  */
    }};

Can anyone provide enlightenment?

Viewing all 4331 articles
Browse latest View live


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