anyone have a way to delete all saved views in a file before I write something to do it? Doesn't look like keyin will do all of them.
Hi Mark,
as you mentioned, you found the solution already, but it's not clear what the solution is.
I am not sure whether key-in can be used to delete all saved view, but using VBA it is:
Public Sub DeleteAllSavedViews() Dim esc As New ElementScanCriteria esc.ExcludeAllTypes esc.IncludeType msdElementTypeView Dim ee As ElementEnumerator Set ee = ActiveModelReference.Scan(esc) Do While ee.MoveNext If ee.Current.IsSavedViewElement Then CadInputQueue.SendKeyin "namedview delete " & ee.Current.AsSavedViewElement.Name End If Loop End Sub
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
A key-in is not possible and what you have posted actually is very close to what I did. Mine is using the collection I built to populate a saved view navigator tool, scans through the saved view list from the collection and deletes them in a loop until no more exist.
Bummer, you would of hoped it would be as easy as "namedview delete all"
~HTH
John.
yep
A suggestion to include this type of option as a key-in could be added to the Ideas section if you think this is required.
RegardsAndrew BellTechnical SupportBentley Systems
John Frampton said:Bummer, you would of hoped it would be as easy as "namedview delete all"
Such key-in will delete named view with its name "all", not "all views" ;-) An asterix wildcard * is standard way to specify all items, but not supported by this particular key-in.
Andrew Bell said:A suggestion to include this type of option as a key-in could be added to the Ideas section if you think this is required.
I had the same thoght, but had not enough time yesterday. So I did it now :-)
Regards,
Jan, I get what you are saying I was just going off the level delete command where "level delete all" will delete all unused levels.
Hi John,
John Frampton said: where "level delete all" will delete all unused levels.
I am surprised! Thanks for this finding ;-)
I have not found the key-in in MicroStation documentation and in my opinion it's dangerous bug: When there will be a script to delete level "all" and this level will not exists in a design file, all levels will be deleted instead of it.
Unambiguous key-in "level delete *" should be used to delete all all (unused) levels.
I created an idea to remove this dangerous key-in from MicroStation.