Input on mouse instead coordinates

GSK2019
Enthusiast
Enthusiast

Input on mouse instead coordinates

GSK2019
Enthusiast
Enthusiast

Hello,

 

Is there is a code that you have a can use, so you can click where something has to be, instead of using coordinates? (something like revision table/Parts list etc).

0 Likes
Reply
Accepted solutions (1)
416 Views
4 Replies
Replies (4)

A.Acheson
Mentor
Mentor

It could be done but would be a more complex process and perhaps unecessary for the user. Is the table not against a border of some kind? You can detect the borders of a sheet, work out the table size if the placement point isnt against a border then  then just move the table against the border. Here is a post with a postion sub routine.

 

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

GSK2019
Enthusiast
Enthusiast

Well that is maybe even better, is it hard to put in a corner every time automatically?

F.e.:

A0_landscape top right

A1_Portrait top right?

0 Likes

A.Acheson
Mentor
Mentor
Accepted solution

If you look for the position sub routine in the precious link you will see border.RangeBox.MaxPoint.X which is the right hand side border and Y the top right hand corner.

For the partslist all you need is this point. If you place it in a sub like the rev table you can call it when you change orientation.

 

oTablePt = ThisApplication.TransientGeometry.CreatePoint2d(oSheet.Border.RangeBox.MaxPoint.X, oSheet.TitleBlock.RangeBox.MaxPoint.Y)

This sub is set up for the rev table on right hand bottom corner.

 

Private Sub	Positiontable( oTablePt As Point2d,oSheet As Sheet)

Dim oRevTableItem As RevisionTable
oRevTableItem = oSheet.RevisionTables.Item(1) 

Dim oWidthRevTable As Double
oWidthRevTable = oRevTableItem.RangeBox.MaxPoint.X - oRevTableItem.RangeBox.MinPoint.X

Dim oHeightRevTable As Double
oHeightRevTable = oRevTableItem.RangeBox.MaxPoint.Y - oRevTableItem.RangeBox.MinPoint.Y

oTablePt = ThisApplication.TransientGeometry.CreatePoint2d(oSheet.Border.RangeBox.MaxPoint.X - oWidthRevTable, oSheet.TitleBlock.RangeBox.MaxPoint.Y + oHeightRevTable)

oRevTableItem.Position = oTablePt
End Sub

 

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

GSK2019
Enthusiast
Enthusiast

Thank you!

0 Likes