For the last couple of years, we have used the attached macro to insert BOMs into our drawings.
Always worked until today. Suddenly we get a runtime 91 error, please see attached.?What has changed over night?
What is the value of boolstatus after the ActivateView line?
If that fails then Set swView = ... will also fail, leading swView to be empty.
Simon and Deepak,
I guess you are both right. I forgot to correct the view name.. My mistake.!Thanks for your quick response..!
You can change the codes to detect the available view on the drawing and insert BOM/Balloons as needed.
Okay.. I'm still messing with it, and can't get it to run.
It's a section view I want to auto balloon and insert a BOM. How do I get it to auto select my section view?I'm not sure it's the active view..?
I would loop through all the views until you find a section view. I'm not sure how to determine whether a view is a section view or not, but I guess you could either check to see if its name contains the word "section", or use GetSectionLineCount2.
Something like (pseudo code):
Dim n As Long
set swView = swDrawing.GetFirstView
While Not swView is Nothing
if swView.GetSectionLineCount2(n) > 0 Then
'This is a section view. Do your work here
Set swView = swView.GetNextView
Ok, got it running. The thing is even the section view is just called view6 in my case.
Probably because I deleted one or two earlier..
Do you've have a drawing view 4 in the drawing? You can change that to first view found on the drawing (after sheet).
Also share the macro to debug/update.
Another thing, the balloons inserted seems to go outside the paper. Seems like the distance between them are too big.
When deleting them and trying to do it manually, they are much tighter.
Are there anyway I in the macro can force them thighter..?
Retrieving data ...