As you pointed out you cannot change the position point of the partlist in the object so you have to work around this fixed placement to work out the new position. To work out the position point for an object you would use the "RangeBox" methods to find the width and height of the objects, most objects have this. Then do some calculation to place it in the appropriate position. Because you may need to work out the size of the partslist you will place it first then work out it's size then position to the correct location. In the code below the first sub routine Moves Partslist from Right of Border to Left. If you need any more help please show the partslist position with an image.
Sub Main
'Set a reference To the drawing Document. ' This assumes a drawing document is active.
Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument
'Set a reference to the active sheet.
Dim oSheet As Sheet = oDrawDoc.ActiveSheet
Dim oBorder As Border = oSheet.Border
Dim oTitleBlock As TitleBlock = oSheet.TitleBlock
Dim oPartsList As PartsList = oSheet.PartsLists(1)
Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
Dim oPt As Point2d = oTG.CreatePoint2d(0, 0)'loosely position Table if inserting for the first time
'Move Partlist
PositionPartslist(oPt, oPartsList, oSheet)
'Show Sizes
Showsize(oBorder,oTitleBlock,oPartsList)
End Sub
'Moves Partslist from Right of Border to Left
Private Sub PositionPartslist(oPt As Point2d,oPartsList As PartsList,oSheet As Sheet)
Dim dWidthPartslist As Double = oPartsList.RangeBox.MaxPoint.X - oPartsList.RangeBox.MinPoint.X
Dim dHeightPartslist As Double = oPartsList.RangeBox.MaxPoint.Y - oPartsList.RangeBox.MinPoint.Y
oPt = ThisApplication.TransientGeometry.CreatePoint2d(oSheet.Border.RangeBox.MinPoint.X + dWidthPartslist, oSheet.Border.RangeBox.MaxPoint.Y)
oPartsList.Position = oPt
End Sub
Private Sub Showsize(oBorder As Border ,oTitleBlock As TitleBlock,oPartsList As PartsList)
Dim dBorderMaxX, dBorderMinX, dBorderMaxY, dBorderMinY As Double
Dim dTitleBlockMaxX, dTitleBlockMinX, dTitleBlockMaxY, dTitleBlockMinY As Double
Dim dPartsListMaxX, dPartsListMinX, dPartsListMaxY, dPartsListMinY As Double
dBorderMaxX = oBorder.RangeBox.MaxPoint.X
dBorderMinX = oBorder.RangeBox.MinPoint.X
dBorderMaxY = oBorder.RangeBox.MaxPoint.Y
dBorderMinY = oBorder.RangeBox.MinPoint.Y
Logger.Info(oBorder.Name & "-" & dBorderMaxX & "-" & dBorderMinX & "-" & dBorderMaxY & "-" & dBorderMinY)
dTitleBlockMaxX = oTitleBlock.RangeBox.MaxPoint.X
dTitleBlockMinX = oTitleBlock.RangeBox.MinPoint.X
dTitleBlockMaxY = oTitleBlock.RangeBox.MaxPoint.Y
dTitleBlockMinY = oTitleBlock.RangeBox.MinPoint.Y
Logger.Info(oTitleBlock.Name & "-" & dTitleBlockMaxX & "-" & dTitleBlockMinX & "-" & dTitleBlockMaxY & "-" & dTitleBlockMinY)
dPartsListMaxX = oPartsList.RangeBox.MaxPoint.X
dPartsListMinX = oPartsList.RangeBox.MinPoint.X
dPartsListMaxY = oPartsList.RangeBox.MaxPoint.Y
dPartsListMinY = oPartsList.RangeBox.MinPoint.Y
Logger.Info(oPartsList.Style.Name & "-" & dPartsListMaxX & "-" & dPartsListMinX & "-" & dPartsListMaxY & "-" & dPartsListMinY)
End Sub
If this solved a problem, please click (accept) as solution.
Or if this helped you, please, click (like)
Regards
Alan