×
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

edit sheet to edit sheet format macro?

edit sheet to edit sheet format macro?

edit sheet to edit sheet format macro?

(OP)
I want a macro to toggle between edit sheet and edit sheet format.  I have been able to get one to go from edit sheet to edit sheet format, and another to go from edit sheet format to edit sheet.  What I really want is one that will toggle to the other no matter which one I am in.  I tried combining the two, but must be missing something.  Anyone have any ideas?

Thanks

RE: edit sheet to edit sheet format macro?


If I might ask???????

How is this macro going to be easier (or faster) to use than a simple right-click on the drawing backgound.



Remember...
       "If you don't use your head,
                       your going to have to use your feet."

RE: edit sheet to edit sheet format macro?

Anyway you obviously have the API calls to cahnge back and forth, all you need to do is to first ask for it to return the value of the current setting and then use retval in a simple IF-THEN statement to apply one or the other.



Remember...
       "If you don't use your head,
                       your going to have to use your feet."

RE: edit sheet to edit sheet format macro?

(OP)
I would like to program the macro to a key on the keyboard.  This is similar to another cad package we have used previously.  I tried the if-then statement and was not getting it to work.

RE: edit sheet to edit sheet format macro?

Can you post what you've got so far?



Remember...
       "If you don't use your head,
                       your going to have to use your feet."

RE: edit sheet to edit sheet format macro?

retval = DrawingDoc.GetEditSheet

RE: edit sheet to edit sheet format macro?

Since I was going to get around to writing a macro anyway to edit specific notes we have in our sheet templates at some point in time. This will serve your purpose and get me started......

Option Explicit

' *********************************************
' Edit Sheet/Sheet Format Toggle
' *********************************************

Dim swApp As Object
Dim DwgDoc As Object
Dim retval As Boolean

Sub main()

Set swApp = CreateObject("SldWorks.Application")
Set DwgDoc = swApp.ActiveDoc

retval = DwgDoc.GetEditSheet()
'True if currently editting sheet, False if currently editting template

    If retval = True Then
        DwgDoc.EditTemplate

    Else
        DwgDoc.EditSheet

    End If

Set DwgDoc = Nothing
Set swApp = Nothing

End Sub



Remember...
       "If you don't use your head,
                       your going to have to use your feet."

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