Hello!
I am creating batch file to perform the following on each sheet file:
1: select plot frame from the reference file ( courtesy one of the threads on this forum)
# loading selectionby for one of the selection options#
load mdl selectby
place fence fromshape;
level element select file:referencefile.dgn framelevel
#trying several options without success in order to initiate choice of the element here#
choose selection
dx=0,0
selview 1
point ab
dl=0,0
selectionby execute
none of the options above create "left-click" effect that would place fence around my selected shape ( which is a single rectangle placed on specific level for the purpose of plotting)
After selecting this shape (manually at this point) I actually need to set fence mode to "VOID", as I would like to delete everything that is selected OUTSIDE of the frame
so, I cannot find the fence mode key-in that would switch fence selection to "void"
reason for above manipulations is, that I am trying to select and delete all tag sets that were double-and triple-placed, and to leave only one that is within the plotting frame. the other method of selection ( by "selectby") would not work in this case , as these tagsets are completely identical, and I will not be able to separate them by properties.
Thank you!
------------------------------
using: AECOSIM Buiding Designer V8i (Select Series 6)
Version 08.11.09.866
Andrew, thank you for a great answer, that is what I was looking to accomplish!
Lorys,
this is what the macro shows:
-----------------------------------------
Sub main Dim startPoint As MbePoint Dim point As MbePoint, point2 As MbePoint
' Start a command MbeSendCommand "PLACE FENCE ICON "
' Set a variable associated with a dialog box MbeSetAppVariable "", "tcb->msToolSettings.fence.placeMode", 3&
MbeSendCommand "PLACE FENCE ICON "
MbeSendCommand "LOCK FENCE VOID OUTSIDE "
' Coordinates are in master units startPoint.x = -126.675673# startPoint.y = 545.974555# startPoint.z = 5.334672#
' Send a data point to the current command point.x = startPoint.x point.y = startPoint.y point.z = startPoint.z MbeSendDataPoint point, 1%
point.x = startPoint.x - 61.444942# point.y = startPoint.y - 76.834425# point.z = startPoint.z MbeSendDataPoint point, 1%End Sub
--------------------------------------
that would mean, that in order to pick a shape, microstation is actually fetching vertices of that shape from the selection, and then sending them to form the fence.
that would be something VBA would do, but not a macro.
Speaking of VBA's, I understand these are not a desirable way of programming automation from this point on for 2 reasons:
1: they cannot be evoked from Projectwise cloud ( unlike .txt batch files)
2: they are being phased out by Bentley in all Open technology ( that is a responce from Bentley Support on my inquiry re: VBA's possible hosting on PW)
so, I think I will try to select text within the print area somehow else.
Thank you for suggestion !
Denis Erlich said:Dim startPoint As MbePoint
That's a BASIC macro, not VBA. Prefer VBA to BASIC.
Denis Erlich said:VBA's possible hosting on PW
I'm not sure what that means. VBA is part of MicroStation. A VBA macro is hosted by MicroStation, meaning that it runs in MicroStation's address space on the same processor.
ProjectWise can't host a MicroStation VBA macro because (a) it's a different process probably on a remote computer and (b) it's not MicroStation.
Since you're working with the V8i generation it's moot whether VBA is 'desirable' — it's there for you to use now, and it remains in the CONNECT generation.
Regards, Jon Summers LA Solutions
Hi Denis,
FYI You can also use the "fence selection new" keyin to select the elements defined by your fence if that helps.
Regards,
Mark
OpenRoads Designer 2022 R3 (10.12) | Microstation 2023.1 | ProjectWise CE 3.4
Jon Summers said: ProjectWise can't host a VBA macro because it's a different process probably on a remote computer.
hey Jon, a little off topic but how can i make a vba macro run under PW?
Surely there must be a way
Lorys
Started msnt work 1990 - Retired Nov 2022 ( oh boy am I old )
But was long time user V8iss10 (8.11.09.919) dabbler CE update 16 (10.16.00.80)
MicroStation user since 1990 Melbourne Australia.click link to PM me