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

How to get the file name to be used for save fence to file?

$
0
0

Hi Everyone,

I'm trying to create a simple VBA script that will place a fence on a certain view, and use place fence save to file to save it on a particular folder in projectwise.

I was able to do it by putting up microstation keyin commands but what i want to do next is to export the file with its own file name automatically. So when other users run the script it will export it based on the file name of the file they are using.

is there a way to do that? Script is pasted below:

Sub BmrExport_Shared_V3()
Dim startPoint As Point3d
Dim point As Point3d, point2 As Point3d
Dim lngTemp As Long
Dim oMessage As CadInputMessage

Dim modalHandler As New BmrExport_Shared_V3ModalHandler
AddModalDialogEventsHandler modalHandler

' The following statement opens modal dialog "Alert"

' Send a keyin that can be a command string
CadInputQueue.SendKeyin "view toggle 8;fit view extended;place fence view 8;fence copy tofile (file name of the active file here);xy=0,0"

' Send a keyin that can be a command string

CadInputQueue.SendKeyin "VIEW TOGGLE 8 "

CadInputQueue.SendKeyin "FIT VIEW EXTENDED 1"

' Send a reset to the current command
CadInputQueue.SendReset

RemoveModalDialogEventsHandler modalHandler
CommandState.StartDefaultCommand
End Sub

I'm using Microstation Connect Edition update 16.

System.String.Substring(System.Path.GetFileName(ActiveFile.FileName),0,29) - I think this is the expression to get the file name but i don't know where to put it.

Cheers,

Cris


Viewing all articles
Browse latest Browse all 7260

Trending Articles



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