Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

iLogic check if drawing view is rendered

m.Bongartz
Explorer
Explorer

iLogic check if drawing view is rendered

m.Bongartz
Explorer
Explorer

I have a rule, which open selected idw-Files, export them to pdf and dwg and close them.

 

For big drawings, some views don't look fully drawn:

mBongartz_0-1623661851462.png

I guess, it's because the exports starts right after opening and the views are not rendered completly (green borders). I need to  check, if every view is rendered.

 

Any ideas?

0 Likes
Reply
522 Views
4 Replies
Replies (4)

Curtis_Waguespack
Consultant
Consultant

Hi @m.Bongartz 

 

You could have the code check for raster views first.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument


For Each oSheet In oDrawDoc.Sheets
	For Each oView In oSheet.DrawingViews		
		If oView.IsRasterView = True Then
			MsgBox("Warning one or more views is a raster view", , "iLogic")
			Return
		End If
	Next
Next

 

m.Bongartz
Explorer
Explorer

This work so far. Thanks!!
This issue is not reproduceable, therefore debugging and testing is not that easy. I will test it for a while and share my results.

Here my code:

'load drawing
For Each oSheet In oDrawing.Sheets
	oSheet.Activate()
	'check if every view is not in rasterView
	While (checkRasterViews(oSheet))
		oSheet.Update()
	End While
Next
'export drawing
'close drawing

Function checkRasterViews(oSheet As Sheet) As Boolean
	'return True if all views are not on RasterMode
	checkRasterView = True
	For Each oView In oSheet.DrawingViews
		If oView.IsRasterView Then
			'View is in Raster Mode --> check unsuccessful
			checkRasterView = False
			Logger.Warn(oView.Name & "is in RasterView")
			Exit For
		End If
	Next
End Function

 

WCrihfield
Mentor
Mentor

The DrawingView object also has a couple other Properties you may want to check also, like 'DrawingView.UpToDate' & 'DrawingView.IsUpdateComplete'.  But I think maybe the one that may be the best fit would be the Sheet's Property called 'Sheet.Status', which uses the 'DrawingSheetStatusBits' enumerator to help you, obviously,  determine the current 'status' the sheet.  You can add these to your arsenal/toolbox for making sure the sheet/views are up to date, before publishing/exporting.

 

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.

If you want and have time, I would appreciate your Vote(s) for My IDEAS :light_bulb:or you can Explore My CONTRIBUTIONS

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

SometimesInventorMakesMeAngry
Advocate
Advocate

I use DrawingOptions.EnableBackgroundUpdates = false just before opening the drawing. It has worked flawlessly in a PDF Exporter app I wrote to export all component PDFs from an assembly.

 

You can store the current setting before starting any exporting, set to false before doing work, then finally change the setting to what it was when you're done. This way, you don't have to iterate over each View, Sheet, Drawing, etc. Every drawing will always be ready for PDF export. If you're only doing one drawing at a time, maybe the above suggestions work better for you.