"Z" <zpratt@[EMAIL PROTECTED]
> wrote in message
news:1114179291.805920.226710@[EMAIL PROTECTED]
>
> Darin Green wrote:
> > Hi, All
> >
> > I have over 300 plansheets that has to be renumbered because sheets
> were
> > either added or deleted. I'm tring to find out if there's any way to
> > generate plansheet numbers based from the file name?
> >
> > Example:
> > Plansheet number: 1 of 300
> > File name: ad9900lh_001.dgn
> >
> > If anyone can help, that would be great!
> >
> > Thanks,
> > Darin
>
> Darin,
>
> There is one way to number your sheets automaticly in Microstation. In
> Microstation v8 the pentable has several new text substitution
> variables.
> Under the Text Substitution settings > Insert Do***ent Set Item there
> are two variables I use. The Current Print Do***ent Number sets the
> current number the batch plot is on. The Current Set Do***ent sets the
> total number of plots in the batch plot. All you have to do is set
> the sheets up in the wright order in the batch plot file and place the
> variable text in the sheets. The sheets will plot in order and with the
> wright number.
> This way, it is easy to add sheets to a set.
>
> Zane
Hi Darin,
If you know basic. This might help.
Sub main
Dim elem1 As New MbeElement
Dim stat As Long
Dim i As Long
Dim filePos As Long
Dim elemText As String
Dim elemText1 As String
Dim directory As String
Dim files() As String
' set the directory to the one that contains
' the drawings you want to modify
directory = "c:\users\mark\lunch and learn\"
' look in the directory to find your files
FileList files(), directory + "*.dgn"
' test to make sure that we found some files
If ArrayDims(files()) > 0 Then
' ok we found some so step into each one and process
For i = 0 To UBound(files())
' open the file for processing
MbeSendKeyin "RD=" + directory + files(i)
' step through every element in the file
filePos = elem1.fromFile(0)
' scan through the design file
Do While filePos >= 0
' test to see if the element you are currently on is
text
if elem1.type = MBE_Text Then
' you found some text so extract the string
stat = elem1.getString (elemText)
' test to see if the extracted string is equal to the
text
' you want to change
if strcomp(elemText, "bob2", 0) = 0 Then
' it is the text you want to change so now change
your text
' bob2 is the new value that you want your text to
be
stat = elem1.setString ("bob4")
stat = elem1.rewrite ()
End If
End If
filePos = elem1.fromFile(filePos +elem1.fileSize)
Loop
Next i
Else
MbeMessageBox "I didn't find any files. You sure" + directory +
"is correct?"
End If
End Sub
Hope this helps.
--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG


|