Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Separate Drawings For Each Model? 5

Status
Not open for further replies.

edreaux

Mechanical
Feb 7, 2006
89
I have been keeping all of my project drawings within one file. (One drawing file per project) This means that a large assebmly will have many drawing sheets in the drawing file. - Is this typical swx practice? If so how can you switch from different sheets without scrolling to find the tab?

Thanks.
 
Replies continue below

Recommended for you

I know a lot of places do all detail drawings in one file. We don't because our assembly drawing requirements are pretty stiff, requiring quite a few views, alternate positions, sections, details, etc. that would kill performance during detailing of parts. Also, if I want to re-use a component in a different project I can easily just copy the part and drawing files to the new job.

If you want to be able to change sheets w/o scrolling around it would be fairly simple to write a macro that would show all the drawing sheets in a list box and switch to the selected sheet when clicked.
 
Is this typical swx practice?
You will probably find all the possible variations are being used.
1 drawing (single sheet) per model file.
1 drawing set (multi sheet) per single assy & related parts.
1 drawing set (multi sheet) for all model files (assy's & parts)
1 drawing set for all assy files plus 1 drawing set per all part files.

I use the last one, as I find it handy to be able to separately print all the assy's, or all the parts.

how can you switch from different sheets without scrolling to find the tab?
I would also like to know if there is a shortcut. On larger drawing sets, I often "collapse" the sheets in the Drawing Manager then scroll & activate from there.

[cheers]
Helpful SW websites FAQ559-520
How to get answers to your SW questions FAQ559-1091
 
If this is something several people have interest in I would be glad to work on some code. I'll have to check that FAQ on where to post files, since straight code won't cut it in this case. :)
 
I do not have the specs here, but mil specs say each part has it's own dwg. If you need (and you should) to control the rev of each part and assy, make each one with own dwg.

Chris
Systems Analyst, I.S.
SolidWorks/PDMWorks 05
AutoCAD 06
ctopher's home site (updated 06-21-05)
FAQ559-1100
FAQ559-716
 
handleman ... What do I need to change to get this to run with SW2005?

[cheers]
Helpful SW websites FAQ559-520
How to get answers to your SW questions FAQ559-1091
 
Shouldn't be much change. You may have to go to Tools->References in the VBA editor and see what's there. I have (in order):

Visual Basic for Applications
SolidWorks Extensibility Type Library
OLE Automation
SldWorks 2006 Type Library
SolidWorks 2006 Constant type library
Microsoft Forms 2.0 Object Library

I would guess you'll need to reference the 2005 versions of the SW libraries. I don't think I used anything that's unique to 2006.

Let me know if it works...
 
OK, I just deselected the "MISSING" ref's & selected the matching SW05 refs & it now works well. Once I make a shortcut it will save a couple of clicks over the collapse & select method.

Thanks handleman [thumbsup2]

[cheers]
Helpful SW websites FAQ559-520
How to get answers to your SW questions FAQ559-1091
 
Got it to work. This is just what I needed. Thanks.
 
Thanks handleman, I have asked for something like this on 2 occasions. I had suggested right-clicking a sheet-tab to select a sheet. This works even better, but I have a suggestion and want to know if it's possible.

Whenever you run this macro, the top sheet (sheet1 for example) in the dialog-box is highlighted with a gray outline. Would it be possible for it to highlight the current sheet that your on?

Flores
SW06 SP4.0
 
No problem, smcadman. Below is the entire code for the main() portion of the macro with the addition of highlighting the current sheet. I streamlined the code a little bit, eliminating some intermediate variables that really weren't needed.

If you're just starting out with this macro you'll still need to download it, since it includes a user form. Once you've downloaded it, you can edit it and replace the code in the SwitchSheets1 module with the code below.

Code:
Dim swApp As SldWorks.SldWorks
Dim swDoc As SldWorks.ModelDoc2
Dim swDwgDoc As SldWorks.DrawingDoc


Sub main()

Set swApp = Application.SldWorks
Set swDoc = swApp.ActiveDoc

If swDoc.GetType <> swDocDRAWING Then
    MsgBox "Please open a drawing document to use this macro."
    Exit Sub
End If

Set swDwgDoc = swDoc
SheetPick.ShtNameBox.List = swDwgDoc.GetSheetNames
SheetPick.ShtNameBox.Value = swDwgDoc.GetCurrentSheet.GetName
SheetPick.Show
While SheetPick.Visible
    DoEvents 'Wait
Wend

If SheetPick.ShtNameBox.Value <> "" Then
    swDwgDoc.ActivateSheet SheetPick.ShtNameBox.Value
End If

Unload SheetPick
Set swDwgDoc = Nothing
Set swDoc = Nothing
Set swApp = Nothing

End Sub
 
handleman You Rock! One oddity is now the dialog-box only pops up on my 2nd monitor, even if I drag it to the 1st monitor and pick a sheet. I AM NOT COMPLAINING, that was just a side note, great job.

Flores
SW06 SP4.0
 
Thanks, smcadman! You can fiddle with the dialog box to make it open up where you want it. Click on the SheetPick form and view its properties. The ones that control the location are StartUpPosition, Left, and Top. The default StartUpPosition is CenterOwner, and each StartUpPosition will give you different behavior. The other wrinkle is that whatever multi-monitor software you're using, if any, can also grab dialog boxes and reposition them where it wants to. If you want it to open consistently in the same spot every time then you can change StartUpPosition to Manual and play with the Top and Left properties until it opens where you want it.

Have fun!
 
smcadman,

in the control panel veiw of your dual monitor setup, do you have your monitors set with #2 on the left and #1 on the right. If so, windows adresses this #2 monitor with negative values, and since top left is called for in startup windows adresses this with the lowes display values (-x,0) rather than (0,0) which is always the value of the upper left pixel in #1.

Nice macro handleman.

 
The left monitor is setup as #1. Not sure if this was the correct way of fixing it, but I set the StartUpPosition to "CenterOwner", and changed the Left to "-150". Whenever I had set StartUpPosition to manual, I was having to move the dialog to the left and downward.

Flores
SW06 SP4.0
 
handleman ... The above macro has stopped working for me, and I have noticed that the Microsoft Forms 2.0 Object Library is no longer available. Was that part of the download you provided? If so would you mind posting a new link for it ... the one posted no longer works.

[cheers]
Helpful SW websites faq559-520​
How to find answers ... faq559-1091​
SW2006-SP5 Basic ... No PDM​
 
That's odd... have you recently updated Office or Windows? The controls I used were very basic, so I believe you should be able to reference any version of the Microsoft Forms Object Library. There should be some version already on your system. It's the same library that all VBA stuff accesses.
 
When I downloaded the macro I had SW05 installed. Since then I have completely uninstalled SW05 and installed both SW06-SP5 & SW07-SP1.

Both Office & Windows have been updated with whatever the Microsoft Update utility had to offer.

[cheers]
Helpful SW websites faq559-520​
How to find answers ... faq559-1091​
SW2006-SP5 Basic ... No PDM​
 
So do you have some version of the Forms library to choose?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor