Hello all,
I am creating a drawing controlled by ilogic. The assembly can vary in size considerably so I have set the IDW to change between sheet size A3 and A2 accordingly using ilogic. However, when the sheet size is changed, the parts list stays in a static position.
Currently, the parts list is situated in the top right corner up against the title block and the border. So when changing from Size A3 to Size A2, the parts list ends up in the middle of the page. Is there anyway i can control the position of the parts list so it changes with the sheet size chage?
I know I could simply move the partslist to the bottom left corner, which is a work around. However, I'd like to be able to keep the drawings in line with the company standard.
As always, any help is appreciated
Many Thanks
get partslist's property position, hope it helps.
'get paper size and set position
dim newposition as point2d
newposition = oPartslist.position
newposition.x=35
newposition.y=10
oPartslist.position = newposition
So change the x and y values.
Place it where you want it, and write code that will grab it's x/y position, than insert that into your original code
Imports System.Windows.Forms Sub Main() Dim doc As DrawingDocument doc = ThisApplication.ActiveDocument Dim oSketched As SketchedSymbol = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingSketchedSymbolFilter, "Select corresponding symbol") Dim pt As Point2d pt = oSketched.Position MsgBox("X: " & pt.X & vbLf & "Y: " & pt.Y) Clipboard.SetText("X: "& pt.X & " Y: "& pt.Y) End Sub
Use something similiar to this.
I am using this code, but it uses the wrong point on the partlist. i need to fix it in the BottonLeft corner for the partlist.
SyntaxEditor Code Snippet
On Error Resume Next Dim oDrawDoc As DrawingDocument oDrawDoc = ThisApplication.ActiveDocument Dim oPartsList As PartsList oPartsList = oDrawDoc.ActiveSheet.PartsLists.Item(1) Dim newposition2 As point2d newposition2 = oPartslist.position '' newposition2.x=41 newposition2.y=6.53 '' oPartslist.position = newposition2
'activating this command part list table will be inserted and will sit on top of title block on lower right corner ' add partslist table oDrawDoc = ThisDoc.Document 'Set a reference to the active sheet. Dim oSheet As Sheet oSheet = oDrawDoc.ActiveSheet Dim oBorder As Border = oSheet.Border ' Set a reference to the first drawing view Dim oDrawingView As DrawingView oDrawingView = oSheet.DrawingViews(1) If Not oBorder Is Nothing Then oPlacementPoint = oBorder.RangeBox.MaxPoint Else oPlacementPoint = ThisApplication.TransientGeometry.CreatePoint2d(oSheet.Width, oSheet.Height) End If ' Create the parts list. Dim oPartsList As PartsList oPartsList = oSheet.PartsLists.Add(oDrawingView, oPlacementPoint) minXpoint = oSheet.TitleBlock.RangeBox.MinPoint.x minYpoint = oSheet.TitleBlock.RangeBox.MaxPoint.Y maxXpoint = oPlacementPoint.x dPointx = oSheet.PartsLists.Item(1).RangeBox.MinPoint.X - minXpoint dPointY = oSheet.PartsLists.Item(1).RangeBox.MinPoint.Y - minYpoint maxYpoint = oPlacementPoint.Y - dPointY Dim newmin, newmax As Point2d newmin = ThisApplication.TransientGeometry.CreatePoint2d(minXpoint, minYpoint) newmax = ThisApplication.TransientGeometry.CreatePoint2d(maxXpoint, maxYpoint) oSheet.PartsLists.Item(1).Delete oPartsList = oSheet.PartsLists.Add(oDrawingView, newmax)
Try this one, working for me for long time, but it doesn't work with assembly
Thank you very much, this leaded me to the right rule,
SyntaxEditor Code Snippet
Dim oDrawDoc As DrawingDocument oDrawDoc = ThisApplication.ActiveDocument Dim oSheet As sheet oSheet = oDrawDoc.ActiveSheet Dim oPartslist As Partslist oPartsList = oDrawDoc.ActiveSheet.PartsLists.Item(1) Dim oPlacementPoint, oPlacementPoint2 As point2d Dim oBorder As Border oBorder = oSheet.Border PartHight=oSheet.PartsLists.Item(1).RangeBox.MaxPoint.Y-oSheet.PartsLists.Item(1).RangeBox.MinPoint.Y TitleY=oSheet.TitleBlock.RangeBox.MaxPoint.Y PointX=oBorder.Rangebox.Maxpoint.x PointY=TitleY+PartHight oPlacementPoint = ThisApplication.TransientGeometry.CreatePoint2d(PointX,PointY) oPartslist.position = oPlacementPoint
Can't find what you're looking for? Ask the community or share your knowledge.