Message 1 of 11
Can I change this working way of rule from point to coordinate
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi
I got rule to generate part list on drawing and It place part list corner of Title Block
problem is it make error often
so i want to change this rule to place by coordinate that i put coordinate like '(100,100)' in a code
could you help me?
Sub Main
If ThisDoc.Document.DocumentType <> DocumentTypeEnum.kDrawingDocumentObject Then Exit Sub
Dim oDDoc As DrawingDocument = ThisDoc.Document
Dim oSheets As Inventor.Sheets = oDDoc.Sheets
Dim oASheet As Inventor.Sheet = oDDoc.ActiveSheet
Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
Dim oTrans As Transaction = ThisApplication.TransactionManager.StartTransaction(oDDoc, "Add PartsLists - iLogic")
For Each oSheet As Inventor.Sheet In oSheets
oSheet.Activate
If oSheet.PartsLists.Count > 0 Then Continue For
If oSheet.DrawingViews.Count = 0 Then Continue For
If oSheet.TitleBlock Is Nothing Then Continue For
Dim oView As DrawingView = oSheet.DrawingViews.Item(1)
Dim oTBPos As Point2d = oSheet.TitleBlock.RangeBox.MaxPoint
Dim oInsPt As Point2d = oTG.CreatePoint2d(oSheet.Width / 2, oSheet.Height / 2)
Dim oPList As PartsList = oSheet.PartsLists.Add(oView, oInsPt)
oDDoc.Update
Dim oPL_Corner As Point2d = oTG.CreatePoint2d(oPList.RangeBox.MaxPoint.X, oPList.RangeBox.MinPoint.Y)
Dim oPLPos As Point2d = oPList.Position.Copy
oPLPos.TranslateBy(oPL_Corner.VectorTo(oTBPos))
oPList.Position = oPLPos
Next
oASheet.Activate
oTrans.End
oDDoc.Update2(True)
End Sub