API pan command
API pan command
(OP)
Hi all
I am playing with custom macros and command buttons. In particular, I would like to see the code for the toolbar functions. Can I see what the actual "pan" or "mate" codes look like, for example. Thanks
I am playing with custom macros and command buttons. In particular, I would like to see the code for the toolbar functions. Can I see what the actual "pan" or "mate" codes look like, for example. Thanks






RE: API pan command
Matt
CAD Engineer/ECN Analyst
Silicon Valley, CA
sw.fcsuper.com
Co-moderator of Solidworks Yahoo! Group
RE: API pan command
Below is what was listed, doesnt work when attached to button though. Even with my limited experience, I dont see a "pan" command?
' ******************************************************************************
' C:\DOCUME~1\haydug\LOCALS~1\Temp\swx3132\Macro1.swb - macro recorded on 07/13/07 by haydug
' ******************************************************************************
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Dim FeatureData As Object
Dim Feature As Object
Dim Component As Object
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
End Sub
RE: API pan command
Pan may not have an actual API function. You may need to look up view functions in the API help. It's not going to be a simple one line of code. From what you described, you'll need the macro to know your current view location, and then to adjust that by so much.
Matt
CAD Engineer/ECN Analyst
Silicon Valley, CA
sw.fcsuper.com
Co-moderator of Solidworks Yahoo! Group
RE: API pan command
ModelDoc2::ViewTranslateminusx
ModelDoc2::ViewTranslateminusy
ModelDoc2::ViewTranslateplusx
ModelDoc2::ViewTranslateplusy
If you have a specific question about how to add mating or panning behaviour into a custom routine then you may need to provide more details about what you wish to accomplish.