Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Automate the drawings views and dimensions of a frame assembly

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
boothdrafting
2250 Views, 6 Replies

Automate the drawings views and dimensions of a frame assembly

boothdrafting
Enthusiast
Enthusiast

The task of placing a base view of each individual frame member is very repeatable. But can it be automated? Here is my process when creating the drawing for the frame members.

  1. place front base view (of which I can only choose from the files I have open?)
  2. place top and bottom views
  3. enable the "start" and "end" planes of the bottom or top view
  4. dimension the length
  5. dimension the cut angles 
  6. repeat for the 50+ frame members 

I am also experimenting with the BOM. I'm getting close to not needing the drawings at all, but to my knowledge, there's no simple way to convey the relative orientation of the cuts without a drawing.

What can I do to save time?

 

Inventor 2021, Windows

 

0 Likes

Automate the drawings views and dimensions of a frame assembly

The task of placing a base view of each individual frame member is very repeatable. But can it be automated? Here is my process when creating the drawing for the frame members.

  1. place front base view (of which I can only choose from the files I have open?)
  2. place top and bottom views
  3. enable the "start" and "end" planes of the bottom or top view
  4. dimension the length
  5. dimension the cut angles 
  6. repeat for the 50+ frame members 

I am also experimenting with the BOM. I'm getting close to not needing the drawings at all, but to my knowledge, there's no simple way to convey the relative orientation of the cuts without a drawing.

What can I do to save time?

 

Inventor 2021, Windows

 

Labels (1)
6 REPLIES 6
Message 2 of 7

boothdrafting
Enthusiast
Enthusiast

Any suggestions? My drawing template and frame assembly is attached to the original post.

0 Likes

Any suggestions? My drawing template and frame assembly is attached to the original post.

Message 3 of 7
A.Acheson
in reply to: boothdrafting

A.Acheson
Mentor
Mentor
Accepted solution

1-3 are possible with ilogic, and would be repeatable by running through the frame members. 

4-5 are the tricky ones. You could dimension the one piece then loop through the other members but chances are it wouldn’t successfully hold the dimension in position especially where cuts and orientation are concerned. 

Search for ilogic automated drawings run from the assembly environment. I have a sample, I can try dig out to do the drawing piece, but it doesn’t have the target frame member piece of the code.

 Haven’t got inv2021 so maybe some screen shots would help as well. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan

1-3 are possible with ilogic, and would be repeatable by running through the frame members. 

4-5 are the tricky ones. You could dimension the one piece then loop through the other members but chances are it wouldn’t successfully hold the dimension in position especially where cuts and orientation are concerned. 

Search for ilogic automated drawings run from the assembly environment. I have a sample, I can try dig out to do the drawing piece, but it doesn’t have the target frame member piece of the code.

 Haven’t got inv2021 so maybe some screen shots would help as well. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
Message 4 of 7
boothdrafting
in reply to: A.Acheson

boothdrafting
Enthusiast
Enthusiast

Thanks for the input. I suppose I'll spend some time learning how to use iLogic. 

0 Likes

Thanks for the input. I suppose I'll spend some time learning how to use iLogic. 

Message 5 of 7
A.Acheson
in reply to: boothdrafting

A.Acheson
Mentor
Mentor
Accepted solution

Here is a simplified iLogic Rule since actually using ilogic first, you can see the benefits of learning immediately.  Simply pasted it as external rule and open the document part or assembly you want to create a drawing for then run the rule. It is set up to just grab a drawing template but if you change this line to include where you save your default template it will use that. Simply remove the apostrophe ['] (uncomment) from the line it will turn black then adjust the file path. Then comment (add  the apostrophe ['] 0  to the line below it to remove that from the rule.

'oDrawingDoc = ThisApplication.Documents.Add(kDrawingDocumentObject,C:\Temp\Templates\Standard.dwg,True)'Enter the file path of the template you want to use
	

External Rule,

Dim oDoc As Document
Dim oDrawingDoc As DrawingDocument
Dim oSheet As Sheet
Dim oBaseView As DrawingView
Dim oUOM As UnitsOfMeasure
Dim oTG As TransientGeometry

oTG = ThisApplication.TransientGeometry
DWGcreate = MsgBox ("Would You Like To Create A Drawing From This Part/Assembly?" & vbLf & vbLf & "This Will Create a Base, Side & ISO View", vbYesNo, "User Prompt")

If DWGcreate = vbYes Then
	oDoc = ThisApplication.ActiveDocument 
	'oDrawingDoc = ThisApplication.Documents.Add(kDrawingDocumentObject,C:\Temp\Templates\Standard.dwg,True)'Enter the file path of the template you want to use by replacing C:\Temp\Templates\Standard.dwg
	oDrawingDoc = ThisApplication.Documents.Add(kDrawingDocumentObject)'Default Drawing, no specific template
	oDrawingDoc.Activate()
	
	oDrawingDoc.Activate()
	
	oSheet = oDrawingDoc.Sheets.Item(1)
	
	oPoint1 = oTG.CreatePoint2d (12,15)
	
	'Scale Choices
	Dim MyArrayList As New ArrayList
		MyArrayList.Add("1/40")
		MyArrayList.Add("1/30")
		MyArrayList.Add("1/20")

		oScale = InputListBox("Select one:", MyArrayList, "", "iLogic", "Scale Choices")
		'oScale = InputBox("Enter Desired Scale", "Scaler", "1:1")

		'oScale = InputBox("Enter Desired Scale - AS A DECIMAL", "Set Drawing Scale", "1")
		'oScale = 1/20'1/3
		If oScale = "1/40" Then
			
		oScale = 0.025
		ElseIf oScale = "1/30" Then
			
		oScale = 0.0333333333
		ElseIf oScale = "1/20" Then
			
		oScale = 0.05

		End If
			
	
	oBaseView = oSheet.DrawingViews.AddBaseView(oDoc, oPoint1, oScale, ViewOrientationTypeEnum.kTopViewOrientation, DrawingViewStyleEnum.kHiddenLineDrawingViewStyle)
	
	Dim oRightView As DrawingView
	Dim oPoint2 = oTG.CreatePoint2d (25,15)
	Dim RightView = oSheet.DrawingViews.AddProjectedView(oBaseView,oPoint2,DrawingViewStyleEnum.kFromBaseDrawingViewStyle)
	
	Dim oIsoView As DrawingView
	Dim oPoint3 = oTG.CreatePoint2d (35,22)
	oSheet.DrawingViews.AddProjectedView(oBaseView,oPoint3,DrawingViewStyleEnum.kShadedDrawingViewStyle)
	
	dwgretrieve = MsgBox ("Would You Like To Dimension Drawing?" & vbLf & vbLf & "This will Retrieve The Dimensions on Base View", vbYesNo, "User Prompt")
	If dwgretrieve = vbYes Then
		oSheet.drawingdimensions.generaldimensions.retrieve(oBaseView)
	End If
End If

Here is a link to an automated drawing from assembly. it took me a while to figure out how to make it all work. This one really has everything down to placing view, view labels etc. 

https://forums.autodesk.com/t5/inventor-customization/ilogic-auto-create-scaled-drawing-from-a-model...

 

I would keep the post open as other user may have completed frame generator specific rules and could help you out, it may just take some time. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan

Here is a simplified iLogic Rule since actually using ilogic first, you can see the benefits of learning immediately.  Simply pasted it as external rule and open the document part or assembly you want to create a drawing for then run the rule. It is set up to just grab a drawing template but if you change this line to include where you save your default template it will use that. Simply remove the apostrophe ['] (uncomment) from the line it will turn black then adjust the file path. Then comment (add  the apostrophe ['] 0  to the line below it to remove that from the rule.

'oDrawingDoc = ThisApplication.Documents.Add(kDrawingDocumentObject,C:\Temp\Templates\Standard.dwg,True)'Enter the file path of the template you want to use
	

External Rule,

Dim oDoc As Document
Dim oDrawingDoc As DrawingDocument
Dim oSheet As Sheet
Dim oBaseView As DrawingView
Dim oUOM As UnitsOfMeasure
Dim oTG As TransientGeometry

oTG = ThisApplication.TransientGeometry
DWGcreate = MsgBox ("Would You Like To Create A Drawing From This Part/Assembly?" & vbLf & vbLf & "This Will Create a Base, Side & ISO View", vbYesNo, "User Prompt")

If DWGcreate = vbYes Then
	oDoc = ThisApplication.ActiveDocument 
	'oDrawingDoc = ThisApplication.Documents.Add(kDrawingDocumentObject,C:\Temp\Templates\Standard.dwg,True)'Enter the file path of the template you want to use by replacing C:\Temp\Templates\Standard.dwg
	oDrawingDoc = ThisApplication.Documents.Add(kDrawingDocumentObject)'Default Drawing, no specific template
	oDrawingDoc.Activate()
	
	oDrawingDoc.Activate()
	
	oSheet = oDrawingDoc.Sheets.Item(1)
	
	oPoint1 = oTG.CreatePoint2d (12,15)
	
	'Scale Choices
	Dim MyArrayList As New ArrayList
		MyArrayList.Add("1/40")
		MyArrayList.Add("1/30")
		MyArrayList.Add("1/20")

		oScale = InputListBox("Select one:", MyArrayList, "", "iLogic", "Scale Choices")
		'oScale = InputBox("Enter Desired Scale", "Scaler", "1:1")

		'oScale = InputBox("Enter Desired Scale - AS A DECIMAL", "Set Drawing Scale", "1")
		'oScale = 1/20'1/3
		If oScale = "1/40" Then
			
		oScale = 0.025
		ElseIf oScale = "1/30" Then
			
		oScale = 0.0333333333
		ElseIf oScale = "1/20" Then
			
		oScale = 0.05

		End If
			
	
	oBaseView = oSheet.DrawingViews.AddBaseView(oDoc, oPoint1, oScale, ViewOrientationTypeEnum.kTopViewOrientation, DrawingViewStyleEnum.kHiddenLineDrawingViewStyle)
	
	Dim oRightView As DrawingView
	Dim oPoint2 = oTG.CreatePoint2d (25,15)
	Dim RightView = oSheet.DrawingViews.AddProjectedView(oBaseView,oPoint2,DrawingViewStyleEnum.kFromBaseDrawingViewStyle)
	
	Dim oIsoView As DrawingView
	Dim oPoint3 = oTG.CreatePoint2d (35,22)
	oSheet.DrawingViews.AddProjectedView(oBaseView,oPoint3,DrawingViewStyleEnum.kShadedDrawingViewStyle)
	
	dwgretrieve = MsgBox ("Would You Like To Dimension Drawing?" & vbLf & vbLf & "This will Retrieve The Dimensions on Base View", vbYesNo, "User Prompt")
	If dwgretrieve = vbYes Then
		oSheet.drawingdimensions.generaldimensions.retrieve(oBaseView)
	End If
End If

Here is a link to an automated drawing from assembly. it took me a while to figure out how to make it all work. This one really has everything down to placing view, view labels etc. 

https://forums.autodesk.com/t5/inventor-customization/ilogic-auto-create-scaled-drawing-from-a-model...

 

I would keep the post open as other user may have completed frame generator specific rules and could help you out, it may just take some time. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
Message 6 of 7

benjamin.smeaton
Community Visitor
Community Visitor

I've created an automatic drawing program (with alot of help from a number of different threads) that works pretty well for creating drawings for assemblies with alot of sub parts, the generator runs through and creates multiple pages and places and dimensions the sub parts and assemblies automatically, including scaling.

 

You will need to edit line 31 to put in the link to your .idw template file.

Also, lines 43 to 46 which are the dimensions in cm to the borders of your drawing.

 

Seems to work fairly well and certainly speeds up my process! let me know if any help needed.

I've created an automatic drawing program (with alot of help from a number of different threads) that works pretty well for creating drawings for assemblies with alot of sub parts, the generator runs through and creates multiple pages and places and dimensions the sub parts and assemblies automatically, including scaling.

 

You will need to edit line 31 to put in the link to your .idw template file.

Also, lines 43 to 46 which are the dimensions in cm to the borders of your drawing.

 

Seems to work fairly well and certainly speeds up my process! let me know if any help needed.

Message 7 of 7
nnakka
in reply to: benjamin.smeaton

nnakka
Contributor
Contributor

Hello,

                Good day. Is there a ilogic rule that can pull out overall dimensions (length and width ) of an assembly view in Inventor?Please help.

 

Thank you

0 Likes

Hello,

                Good day. Is there a ilogic rule that can pull out overall dimensions (length and width ) of an assembly view in Inventor?Please help.

 

Thank you

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report