Talk About Network

Google





Computer Aided Design - CAD > Programming with Microstation > Re: Automatic S...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 3 Topic 354 of 479
Post > Topic >>

Re: Automatic Sheet Numbering

by "Mel Arquiza" <carquiza@[EMAIL PROTECTED] > Jul 8, 2005 at 03:59 AM

"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
 




 3 Posts in Topic:
Automatic Sheet Numbering
"Darin Green" &  2005-04-15 21:16:46 
Re: Automatic Sheet Numbering
"Z" <zpratt@  2005-04-22 07:14:51 
Re: Automatic Sheet Numbering
"Mel Arquiza" &  2005-07-08 03:59:30 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Fri Jan 9 14:28:54 PST 2009.