Message 1 of 5

Not applicable
08-04-2017
01:04 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I have this illogic that creates an A-size drawing and adds the drawing view for front view at the scale of 1/8 : 1.. I want that to read 1 1/2" = 1'-0" but cant get it to work. Please help.
See attached illogic rules
1/8:1 and 1 1/2" = 1'-0" is basically the same thing so I keep on changing it to 1 1/2" = 1'-0" just because its the company's standard.
Thanks in advance!
Format:HTML Format Version:1.0 StartHTML: 165 EndHTML: 40081 StartFragment: 314 EndFragment: 40049 StartSelection: 314 EndSelection: 314SyntaxEditor Code Snippet
'Function CreateDrawing_PlaceViews (PartNumber As String, DrawingViewScale As Double, ViewsToPlace As String, AssemblyDrawing As Boolean, ByRef oBaseView As DrawingView, ByRef oView2 As DrawingView, ByRef oView3 As DrawingView, ByRef oView4 As DrawingView) Imports Inventor.ViewOrientationTypeEnum Imports Inventor.DrawingViewStyleEnum Dim oDrawDoc As DrawingDocument Dim oPartDoc As Document Dim oSheet As Sheet 'Dim oDrawDoc As DrawingDocument = ThisDoc.Document Dim oDrawingView As DrawingView 'Dim oSheet As Sheet = oDrawDoc.ActiveSheet Dim oPlacementPoint As Point2d Dim oBorder As Border Dim oPlaceX As Double Dim oPlaceY As Double Dim oPartsList As PartsList Dim AssemblyDrawing As Boolean 'Dim oTG As TransientGeometry 'Dim oPoint1 As Point2d 'Dim oPoint2 As Point2d 'Dim oPoint3 As Point2d Filename = ThisDoc.FileName(False) 'If this is the Assembly View, then use this Document as reference and open Drawing Template 'Otherwise use the given Part Number And invisibly open the part, Use the active drawing 'f AssemblyDrawing = True Then 'oPartDoc = ThisDoc.Document DocType = ThisDoc.Document.DocumentType If DocType = DocumentTypeEnum.kAssemblyDocumentObject Then oPartDocPath = ThisDoc.Path & "\" & Filename & ".iam" oPartDoc = ThisApplication.Documents.Open(oPartDocPath, False) oDrawDoc = ThisApplication.Documents.Add(kDrawingDocumentObject, "K:\Mech\INVENTOR2016\Inventor Resources\Templates\RAUTE_2016.dwg", True) oPLS = oDrawDoc.StylesManager.PartsListStyles.Item("MULTIPLE-SINGLE PARTS LIST") 'Else AssemblyDrawing = False Else If DocType = DocumentTypeEnum.kPartDocumentObject Then oPartDocPath = ThisDoc.Path & "\" & Filename & ".ipt" oPartDoc = ThisApplication.Documents.Open(oPartDocPath, False) 'DrawDoc = ThisApplication.ActiveDocument oDrawDoc = ThisApplication.Documents.Add(kDrawingDocumentObject, "K:\Mech\INVENTOR2016\Inventor Resources\Templates\RAUTE_2016.dwg", True) oPLS = oDrawDoc.StylesManager.PartsListStyles.Item("SINGLE PART LIST") End If 'Set a reference to the sheet format Dim oFormat As SheetFormat Try oFormat = oDrawDoc.SheetFormats.Item("A-SIZE SHEET") Catch MessageBox.Show("Error: the named sheet format might not exist.", "iLogic") Return End Try 'Create a new sheet based on the sheet format using the specified model'Dim oSheet As Sheet oSheet = oDrawDoc.Sheets.AddUsingSheetFormat(oFormat) oSheetName = "Sheet:1" oSheet1 = ThisApplication.ActiveDocument.Sheets.Item(oSheetName) oSheet1.Delete 'oSheet = oDrawDoc.Sheets.Item(1) oTG = ThisApplication.TransientGeometry 'Dim oTG As TransientGeometry'Set points in order to get wanted View (ie. if 'Y' is the same and 'X' is greater or less, you will get a Side View) oPoint1 = oTG.CreatePoint2d(13, 12) Dim DrawingViewScale As Double 'Dim ViewScale2 As Double ' ViewScale1 = 1.0 ' ViewScale2 = 5.0 'RoundToFraction(DrawingViewScale, 1/32, RoundingMethod.Round) DrawingViewScale = 1/8 'Create the Base View oBaseView = oSheet.DrawingViews.AddBaseView(oPartDoc, oPoint1, DrawingViewScale, ViewOrientationTypeEnum.kFrontViewOrientation, DrawingViewStyleEnum.kHiddenLineDrawingViewStyle, "Master") oBorder = oSheet.Border oDrawingView = oSheet.DrawingViews(1) oPlacementPoint = oBorder.RangeBox.MaxPoint 'oPlacementPoint = oBorder.RangeBox.MinPoint'oPlacementPoint = ThisApplication.TransientGeometry.CreatePoint2d(27,0) 'Create the parts list. Try oPartList = oSheet.PartsLists(1) Catch oPartsList = oSheet.PartsLists.Add(oDrawingView, oPlacementPoint) 'oDrawingView'Set parts list To a specific layer oPartsList.Layer = oDrawDoc.StylesManager.Layers.Item("Visible (ANSI)") 'Set parts list To a specific style'oPartsList.Style = oDrawDoc.StylesManager.PartsListStyles.Item("MULTIPLE-SINGLE PARTS LIST") oPartsList.Style = oPLS 'reposition parts list to top left oPlaceX = oBorder.RangeBox.MinPoint.X + (oPartsList.RangeBox.MaxPoint.X - oPartsList.RangeBox.MinPoint.X) oPlaceY = oBorder.RangeBox.MaxPoint.Y oPlacementPoint = ThisApplication.TransientGeometry.CreatePoint2d(oPlaceX,oPlaceY) oPartslist.position = oPlacementPoint End Try auto = iLogicVb.Automation auto.RunExternalRule(oDrawDoc,"AutoFill Border") 'Return the Drawing Document 'Return oDrawDoc'Dim oBaseViewOptions As NameValueMap'oBaseViewOptions = ThisApplication.TransientObjects.CreateNameValueMap ' Set the representations to use when creating the base view. ' oBaseViewOptions.Add("PositionalRepresentation", "Position1") 'oBaseViewOptions.Add("DesignViewRepresentation", "View1") 'oBaseViewOptions.Add("DesignViewAssociative", True)'End Function iProperties.Value("Project", "Project") = iProperties.Value(oPartDoc, "Project", "Project")
Solved! Go to Solution.