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

Guidance Request: Select Elements using VB.NET

$
0
0

Hi,

I could find information on "GetSelectedElements()" but could not find on how to go for Selecting Elements.

I wish to do the following:

1) Shift the Focus to USN (From VB.NET) with a Prompt / Message.

2) Select Elements.

3) Go Back to .NET application (for Processing).

Thanks.


[CONNECT, C++] DLL load error

$
0
0

When a dll (ibdas_v8_64.dll) application is placed somewhere in the path, the dll is not found, while it works if it is placed in the MDLAPPS-directory (not in the path) . This is a fatal error as DLL'S shall always be found via the path and with Microstation V8 SDK it works.

Error message (screen dump): 

Dll Loader: unable to find ibdas_v8_64.dll

MDL Loader: Unable to load library (DLL or MDL shared library) ibdas_v8_64

 

 

Microsoft Windows [Version 6.1.7601]

Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

 

 

C:\Ibdas\shell>dir *.dll

Volume in drive C is OSDisk

Volume Serial Number is B2CC-9DC7

 

Directory of C:\Ibdas\shell

 

22-05-2014  12:16        29,283,328 gem.dll

10-04-2012  16:37        15,472,128 ibdas_main.dll

15-04-2016  11:11        33,843,200 ibdas_v8.dll

18-04-2016  10:21        68,180,480 ibdas_v8_64.dll

23-10-1995  12:50            33,280 SP32W.DLL

               5 File(s)    146,812,416 bytes

               0 Dir(s)  63,488,323,584 bytes free

 

C:\Ibdas\shell>set path

Path=c:\Program Files (x86)\Intel\Composer XE 2015\bin\intel64;c:\Program Files

(x86)\Intel\Composer XE 2015\redist\intel64\compiler;C:\Program Files (x86)\Micr

osoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Pr

ogram Files (x86)\Microsoft SDKs\F#\3.1\Framework\v4.0\;C:\Program Files (x86)\M

SBuild\12.0\bin;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\

;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\x86_amd64;C:\Program

Files (x86)\Microsoft Visual Studio 12.0\VC\BIN;C:\Program Files (x86)\Microsof

t Visual Studio 12.0\Common7\Tools;C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319

;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\VCPackages;C:\Program Fi

les (x86)\HTML Help Workshop;C:\Program Files (x86)\Microsoft Visual Studio 12.0

\Team Tools\Performance Tools;C:\Program Files (x86)\Windows Kits\8.1\bin\x86;C:

\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64\;C:\

Program Files (x86)\VNI\imsl\fnl600\Intel64\lib;c:\Program Files (x86)\Intel\Com

poser XE 2015\redist\intel64\mkl;c:\Program Files (x86)\Intel\Composer XE 2015\r

edist\intel64\compiler;C:\ibdasmod;c:\ibdas\shell\;C:\Program Files (x86)\Common

Files\Intel\Shared Libraries\redist\intel64_win\mpirt;C:\Program Files (x86)\Co

mmon Files\Intel\Shared Libraries\redist\intel64_win\compiler;C:\Program Files (

x86)\Common Files\Intel\Shared Libraries\redist\ia32_win\mpirt;C:\Program Files

(x86)\Common Files\Intel\Shared Libraries\redist\ia32_win\compiler;C:\Program Fi

les (x86)\SlickEditV19.0.1\win\;C:\Program Files (x86)\Common Files\Intel\Shared

Libraries\redist\intel64\mpirt;C:\Program Files (x86)\Common Files\Intel\Shared

Libraries\redist\ia32\mpirt;C:\Program Files (x86)\Common Files\Intel\Shared Li

braries\redist\intel64\compiler;C:\Program Files (x86)\Common Files\Intel\Shared

Libraries\redist\ia32\compiler;c:\wint\bin;C:\Program Files (x86)\VNI\imsl\fnl6

00\Intel64\lib;C:\Program files\MPICH2\bin;C:\Program Files (x86)\VNI\imsl\fnl60

0\IA32\lib;C:\Program files\MPICH2\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS

\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\win32app\ingr\ipsh

are\bin;c:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;C:\Program Fi

les (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\Windows Kits\8.1\Windows Pe

rformance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;c:\Prog

ram Files (x86)\Intel\Composer XE 2015\redist\intel64\mpirt;

 

C:\Ibdas\shell>

[V8i VBA] Attempting to automate placement of multiple points along element using VBA

$
0
0

Not sure if this is achievable or not so looking for some confirmation.

Scenario:

I have a DGN file which contains a long linestring and I need to place 109 points at unique distances (from a .XLS file) along the element starting from its left end.

What have I done so far?

  1. I have recorded a macro of myself placing a point along the element  using the 'Construct Active Point @ Dist Along Element'. (keyin: CONSTRUCT POINT DISTANCE)
  2. I copy out the relevant VBA code from the recorded macro and paste into an excel spreadsheet into column A. The copied VBA code is changed slightly by replacing the distance value typed into dialog box with a keyword string.
  3. Column B contains the distances of each desired point location (I per cell per row)
  4. Column C contains a formula to locate where in the coped VBA code that this keyword exists and returns a number.
  5. Column D uses the replace function to display the final output of replacing the keyword with the distance.
  6. I copy out the result of column D into notepad ++, remove additional quotation marks that get created when taking text out of excel and paste into the macro in MicroStation VBA editor.

What happens now?

I run the macro and I can see the dialog box rapidly change numbers however no points are created. The Message Center says no element found so it appears the code isn't using the source element even though the startPoint coordinates were automatically found from the element in the macro recording.

Is there anything that can be done to the code to have the points created on the source element??

Thanks

Microstation v8 C MDL TagValue change not committed

$
0
0
I'm using a scan to go through all the tag elements in a dgn file. I then extract the value and change it and then create the tag in the place of the old one with the new value. I have checked the value this returns and this is successful.

I then try to append the element using mdlElement_append() and this returns a 0 - which sounds like a success to me. When I then open the file at the end of everything however, the tag is unchanged.

It feels like I am missing some sort of commit or transaction, can anyone help?


if(mdlTag_extract(NULL,NULL,&tagSpec,&displayable,&tagValue,NULL,NULL,NULL,NULL,NULL,&pCurrent->el,MASTERFILE) == SUCCESS)
{
	if (strcmp(tagSpec.set.setName, tagSetName))
	{ 
		/* match TagSetName */
		if (strcmp(tagSpec.tagName, tagName))
		{		
                        /* match TagName*/
			tagValue.val.stringVal = newStrVal;
			
			if (mdlTag_create(&pCurrent->el, NULL, NULL, NULL, &tagValue, NULL, NULL, NULL, NULL, NULL, NULL))
			{ status = mdlElement_append(&pCurrent->el); }
		}
	}
}

[CONNECT, C++] Read XAttribut values

$
0
0

Hi

I would like to read some XAttributes values from elements. The values is listed In the element information window (please see the attached screendum). I've attached a design file with just a few elements with XAttributes. In V8i I could read this information via XMLInstanceAPI but I can't figure out how to read it in Connect. Until now I got this:

        XAttributeHandlerId handlerId = XAttributeHandlerId(0, 0);
	XAttributeCollection col = XAttributeCollection(elmRefIn, handlerId);
	int count = 0;
	XAttributeCollection::const_iterator iterEnd = col.end();
	for (XAttributeCollection::const_iterator iter = col.begin(); iter != iterEnd; ++iter)
	{
		(*iter).GetHandlerId();
(*iter).GetId()); (*iter).PeekData(); count++; }

I can read the HandlerId's / Id's and I can get the data as a void pointer and then what ? Please note that I'm not the author of the data.

I've been looking through the documentation and this forum but I've not been able to find the clue in how to go on...

TIA...

Regards, Evan

(Please visit the site to view this file)

[Connect VBA] Password a module

$
0
0

I'm being told by a developer that when they password a VBA module it causes Connect to abort.  For that reason they will not be upgrading any of their utilities for Connect.  

Could anyone here verify this to be the case.  That password modules won't run in Connect

Many Thanks,

DavidG

Flattening Shapes - it's all double Dutch to me ...

$
0
0

Attached you can find a sample .dgn file which shows 4 shape elements


I need to flatten the shapes so that each one is perpenticular to it's base edge - it should look like this:

 (Please visit the site to view this file)

The shapes need to be flattened - not only rotated!


How do I achieve this? Each idea is very much appreciated!

MDL coud not Load by .cfg file

$
0
0

Hello,

I have been creating a MDL addin for microstation using visual studio. 

I use a config file to automatically load the addin to MS while opening the DGN file.

My problem is that i have already created another addin for another project and i can't load the same addins at the same time with two different configs.

Please someone help me with this.

Subin


[Connect C++] Using -s command line parameter to load an application fails

$
0
0

To load our application in V8i we use the command line option -s"script file path". The script file just contains a command that is defined in our application.

When I try the same thing in Connect nothing happens. I have verified the configuration by typing the same command into the key-in in Connect.

Anyone that knows what the problem might be?

Thanks!

Christian

[Connect C++] How do I add a ribbon tab from a dgnlib when the application starts?

$
0
0

Hi.

I have created a ribbon tab in a dgnlib and want to load this into Connect when our application starts. How do I do that?

With the help from you I managed to load tasks into the task list in V8i but the same procedure doesn't seem to apply to the ribbons.

Thanks in advance.

Christian

using Impersonate or Runas

$
0
0

Is it possible to leverage a system account, impersonate, or runas in VBA? We have a situation where we need VBA to programmatically create folders in an area where the user does not have rights to do so. An example would be very helpful. TIA

ODBC Error when trying to run a select statement

$
0
0

I am working with the delivered sample C# application to test out some things.  I am trying to query the i.dgn file for information.  I am running this select statement: Select * from 06_MP_CMM_AGPIPE_i_dgn.OpenPlant_3D_01_06.BELLOWS .  It is passed in to the C# code into a OdbcCommand then executed in an OdbcDataReader which then has an exception.  The error is ERROR [42000] [Simba][SQLEngine] syntax error near 'Select * from 06<<< ??? >>>_MP_CMM_AGPIPE_i_dgn.OpenPlant_3D_01_06.BELLOWS'.  Is there some documentation on the eror?  

thanks,

marka

Text style NONE, but in VBA - show - that exist style

$
0
0

Text style, when I see it direct in Mocrostation - see, that text style is none. But in VBA code, when I will find this - it dos not show it. Is there Text stile like Tahoma_01_CC etc, what I have use in different file. Is it possible to catch this none - from VBA side?

And it not always so - some times cacth out this none style from VBA side.

Print Organizer issues in VBA

$
0
0

I have an issue (I know it's a bug as per Bentley) where I cannot get the Print Organizer to load the workspace in VBA.  

I have also figured out that loading the active design file using $(_dgnfile) is the main part of the issue.  If I pull the actual value for $(_dgnfile) and use that in the VBA, the file will attempt to load.  This is where my latest issue is.

The PO will show that it is "Checking Out Documents..." and stay hung.  I have MS_PRINTORGANIZER_OPEN_DGN_READWRITE=0.  I tried 1 based on other forum posts and that went horribly wrong.

Here is the commands I use:

mdl load bentley.microstation.printorganizer.dll

printorganizer new

printorganizer printerDriver pdf.pltcfg

printorganizer add file {Actual File Name} sheet1

printorganizer submitas single

printorganizer printdestination C:\temp\1.pdf

printorganizer print all

printorganizer exit

Any help is greatly appreciated.  This has run into dozens of hours for a stupid bug that may/may not be ever fixed.  

This is MS version 08.11.09.714

Thanks,

Mike

[V8i C++] Callback function definition for SYSTEM_UPGRADEV7TOV8

$
0
0

Are there any function parameters for the callback function SYSTEM_UPGRADEV7TOV8 (  i.e. mdlSystem_setFunction (SYSTEM_UPGRADEV7TOV8, myFunction ) ? I don't see it described in the help or .h/.fdf files.

void (?) myFunction (???)

{

}

Thanks,

Bruce


[V8i VBA] ILocateCommandEvents_Accept Event Handler Query

$
0
0

I currently have a function (called Return Array) in a module which returns string array by reading the contents of a text or CSV file. I have tried to pass this array to the ILocateCommandEvents_Accept event handler but I get this error:

The function is coded as:

Public Function ReturnArray() As String()
' ---------------------------------------------------------------------
'// Function to return an array of user defined distances
' ---------------------------------------------------------------------
	Dim astrDistances() As String
	LoadTextFile (strFileName)
	astrDistances = Split(LoadTextFile(strFileName), vbCrLf, -1, vbTextCompare)
' Check to see if source file contains distances
	If IsArrayAllocated(astrDistances) = True Then
		Debug.Print "Array has been Redim'd"
		ReturnArray = astrDistances
		MainForm.ListBox1.List = ReturnArray
		ILocateCommandEvents_Accept ReturnArray
	Else
		Debug.Print "Array hasn't been Redim'd or was Erased."
	End If
End Function

My _Accept event handler in the Class is currently coded as:

Private Sub ILocateCommandEvents_Accept(ByVal Element As Element, point As Point3d, ByVal View As View, ByRef ReturnArray() As String)
    Dim i As Integer
    Dim oElement As LineElement
    Set oElement = Element
    For i = LBound(ReturnArray) To UBound(ReturnArray)
        oElement.PointAtDistance (ReturnArray(i))
        oElement.Redraw msdDrawingModeNormal
        ActiveModelReference.AddElement oElement
        Next i
        CommandState.StartDefaultCommand
    End Sub

As written in my previous thread, I'm not entirely sure what I'm doing and kinda stumbling in the dark. I'm not sure if the array is better created in the _Accept event handler or fine within a module as is but need to change event handlers parameters but I do not know what it should be changed to. 

[Connect C#] SetCExpressionValue replacement in DgnPlatformNet API?

$
0
0

I am trying to disable the "Move Camera" option in the Pan View dialog. 

Recording a macro takes shows me that I need to modify the vtSettings.m_viewCmdsMoveCamera variable.  In V8i, I would use SetCExpressionValue, but I do not see an alternative in Connect using the new API. Suggestions?

Bought the Learning Microstation VBA book but the CD doesn't work

$
0
0

Hi I bought the Learning Microstation VBA book in 2014 but only managed to use the book recently I tried to view files on the CD they provided but its not reading. Where can I get the files on this pls.

Kind regards,

Pes

[Connect C#] Dot NET 4.6.1

$
0
0

Has anyone had any experience with trying to write an AddIn in Dot NET 4.6.1 and getting it working with MS Connect?

Thanks and regards

Paul

Change Color Independent of Fill Color

$
0
0

I have element templates that allow setting multiple properties quickly in VBA by using:

PropertyHandler.SelectByAccessString "Template"

After setting the value of the property handler to the name of the template, I would like to override one of the properties (color) without affecting anything else.

It seems that setting the color is also setting the fill color at the same time.

How should I isolate and change just the color without the fill color?

Viewing all 4331 articles
Browse latest View live