×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Automatic increase annotation value

Automatic increase annotation value

Automatic increase annotation value

(OP)
Hello to you all
 
I have to identify over 200 objects with a code which includes a number eg  FR01 to FR200.  Is there an easier way of inserting the annotation which would automatically increase the number by 1.  Could a lisp do it?
 
Any advice would be appreciated

RE: Automatic increase annotation value

But of course

You have to be a little more specific what you are trying to accomplish.

"Whether you think that you can, or that you can't, you are usually right "
.. Henry Ford

RE: Automatic increase annotation value

Here is a VERY quick and dirty program snippet in VBA that will do what you ask.  There is no error checking or user input other than the point for the text to be created.  This could be made pretty, but I'm not sure it's worth the effort if your only going to do this once.

VBA Code Follows....

CODE

Public Sub test()
    Dim objText As AcadText
    txt = "FR"
    For i = 1 To 200
        ptStart = ThisDrawing.Utility.GetPoint(, "Pick the center point for the text: ")
        Select Case i
            Case Is > 99
                txt = txt & Trim(Str(i))
            Case 10 To 99
                txt = txt & "0" & Trim(Str(i))
            Case 1 To 9
                txt = txt & "00" & Trim(Str(i))
        End Select
        Set objText = ThisDrawing.ModelSpace.AddText(txt, ptStart, 0.2)
        objText.Update
        txt = "FR"
    Next i
    
End Sub

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources