Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
doug.johnston
in reply to: Anonymous

I created a drawing template for work that places the Parts Lists, updates the positions of the views and scales the views based on a scale factor number.

 

The code uses the VIEW TITLE  to position each view and the scale is based on the OVERALL LENGTH & OVERALL WIDTH custom parameters inside the model.  And I can adjust the scale factor in the code to adjust the views sizes.

 

I had to setup the template first because most of my drawings always have the same view titles / positions / etc  and I have to occasionally change the code slightly based on the view titles for other drawings.  It does not place the views on an empty sheet.

 

By creating the IDW template with some ilogic rules,  I have reduce the amount of time spent on the drawing from hours to minutes.  Basically, I've got it to a point that I can update and print with a couple clicks of the mouse.

 

Create a drawing template that can handle 80-90% of your drawing requirements.

 

 

Here is a picture of the the template and the ilogic I use.

 

DRAWING TEMPLATEDRAWING TEMPLATE

 

'''***********************
'''*** POSITIONS VIEWS ***
'''***********************

'''*** Declares and reads all sheets in idw file
oSheets = ThisApplication.ActiveDocument.Sheets


'''*** Sets view positions for X-XXXXX from bottom-left corner of border (X & Y)
'oSheets.Item(1).Activate ''-- uncomment code for multiple sheets amd change number to total number of sheets

	ActiveSheet.View("TOP VIEW").SetCenter(6.00, 11.00)  ''*** drawing view position from center of view (X & Y)
	ActiveSheet.View("FRONT VIEW").SetSpacingToCorner(2.25, 4.50, SheetCorner.BottomLeft)
	ActiveSheet.View("SIDE VIEW").SetSpacingToCorner(11.50, 8.00, SheetCorner.BottomLeft)
	ActiveSheet.View("3D VIEW").SetSpacingToCorner(11.75, 7.50, SheetCorner.BottomLeft)
	ActiveSheet.View("A").SetSpacingToCorner(20.50, 5.00, SheetCorner.BottomLeft)
	ActiveSheet.View("FRONT PLATE - HOLE DIMENSIONS").SetSpacingToCorner(2.25, 2.50, SheetCorner.BottomLeft)




'''********************
'''*** SCALES VIEWS ***
'''********************

'''*** Sets view scale for TOP VIEW based on overall dimensions (X&Y)
If Parameter("B_BOTTOM FRAME_STANDARD.iam.external_overall_WIDTH") >= Parameter("B_BOTTOM FRAME_STANDARD.iam.external_overall_DEPTH") Then
Max_Overall_Dim = Parameter("B_BOTTOM FRAME_STANDARD.iam.external_overall_WIDTH")
Else
Max_Overall_Dim = Parameter("B_BOTTOM FRAME_STANDARD.iam.external_overall_DEPTH")
End If

'''*** Generic scale factor for views (Change number to suit)
ScaleFactor_Proportion = 7.5 

'''*** Second number in the scale factor
X = Ceil(Max_Overall_Dim/ScaleFactor_Proportion)

'''*** Changes view scale 
ActiveSheet.View("TOP VIEW").ScaleString = "1:" & X

 


---------------------------------------------------
It's not easy maintaining this level of insanity !!!!!