DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

BasicCAD code for highlighting points

Started by Lar, July 27, 2016, 11:56:43 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Lar

DT, I guess this question is for you:

I remember seeing in the old Macros Help file (v17 was the last) the code for highlight points (for manipulating them in Point Select Mode) but since I have Win10 I can't open that help file. Can you (or anyone) post the text for that topic please?

I'm not even sure it was in the ole Macros Help but I id see it somewhere.

Thanks,
Lar

DrollTroll

#1
DragSelect
>DragSelect
{
Type t
[0 = select only items inside box, 1 = add items inside box to current selection, 2 = select only items inside or touched by box, 3 = add items inside or touched by box to current selection]
[for Point Select Mode: 0 = new point selection, 1 = add enclosed points, 2 = remove enclosed points, 3 = toggle status of enclosed points]
<Points: 1 = 1st corner of selection rectangle, 2 = opposite corner
}


This selects entities by drawing a rectangle around them. Alternatively, it can be used while in PointSelectMode to select multiple points in one or more selected entities.
Compatibility: All versions.
Example: Select all entities within a 10 x 10 x 10 cube centered on the origin.

>SelectMode3D
{
}
>DragSelect
{
<Type 0
<Pointxyz -5, -5, -5
<Pointxyz 5, 5, 5
}


See DragMoveSelectedPoints for an example of usage with PointSelectMode.


DragMoveSelectedPoints

>DragMoveSelectedPoints
{
<Points: 1 = starting location; 2 = ending location
}


This moves the selected points of the selected entity. The points are offset by the distance and direction between the two points set.

Note: This command only works while in Point Select Mode with at least one entity selected and at least one point highlighted for editing.
Compatibility: Version 13 and later.
Example:

retry:
Message "Select an entity on the screen"
SetPoint "Set a point on an entity", 1
PointVal x y z 1

>PointSelect
{
<Type 0
<Pointxyz [x, y, z]
}
If Sys(80) < 1 Then Goto retry

If Not Sys(345) Then
>PointSelectMode
{
}
End If

Message "Select some points on the entity."
retry2:
Sys(41) = 2 'show a rubberband box
SetPoint "Set 2 points for a box...", 2
If Sys(1) < 2 Then Goto retry 2
>DragSelect
{
PointVal x, y, z, 1 'use 1st point
<Pointxyz [x, y, z]
PointVal x, y, z, 2 'use 2nd point
<Pointxyz [x, y, z]
}
Message "Moving the selected points over 5 and up 5..."
>DragMoveSelectedPoints
{
<Pointxyz [x, y, z]
<PointRel 5, 5, 0
}

25 years with DesignCAD

DrollTroll

#2
I have been working, with some assistance from edgar, to convert the old Macros17.hlp content into a format that will, eventually, be in PDF format rather than WinHelp. See the BasicCAD board for the latest rev of this effort.

http://forum.designcad.com/index.php?topic=5.msg47537#msg47537

Note to self: fix the DragMoveSelectedPoints example to actually use that command
25 years with DesignCAD

Lar

#3
Thanks DT.

I found the codes using Macro Record (I was surprised they actually recorded).

My main thing was how to highlight points but I halfway remembered reading to set the 2 drag-points right on top of the point (so you have to highlight them one at a time).

For deleting points the recorded 'SelectSubtractPoint' did not work. I had to use 'deletepoints'.

Below are the codes in a sample macro:

'run in a new file....
sys(1027)=1   'ok/cancel message box...
message "This test macro should only be ran in a new empty file ...Press CANCEL if you want to end..."
if sys(1028)=2 then end

>Line
{
  <PointXYZ -5,0,0
  <PointXYZ 5,0,0
  }

>PointSelect
{
  <PointXYZ -5,0,0
  }

>FitToAllWindow
{
}

message "Pause to view new 2-point line, selected...

>SelectAddPoint
{
  <PointXYZ 0,0,0
  <PointXYZ 0,0,0
  }

message "Pause to view new point in center, un-highlighted..."

>PointMove
{
  <PointXYZ 0,0,0
  <PointXYZ 2,0,0
  }

>regenerate
{
}

message "Pause to view point moved to right (had to regenerate) ..."

>DragSelect
{
  <PointXYZ 2,0,0
  <PointXYZ 2,0,0
  <Type 0
  }

message "Pause to view highlighted point..."

>deletepoints    'SelectSubtractPoint that was macro recorded did not work...
{
  }

message "Point is deleted..."




Lar

DrollTroll

#4
Try adding this line to Macrocmd.ini
SelectSubtractPoint=ID_SELECT_SUBPOINT

right after
SelectSlant=ID_SELECT_SLANT

then restart DesignCAD and see if your macro works as recorded.

Looks like I told it how to record that command but not how to play it back.
25 years with DesignCAD

Lar

DT,

I did as you instructed in v23 and the latest beta.

In 23 it deleted the first point only (which was not highlighted).

In the beta it still did not work, but I'm not sure I edited the correct Macrocmd.ini file. I will try again early tomorrow (I was coding all day and my brain wants to knock off).

Lar

DrollTroll

Well, SelectSubtractPoint isn't documented anywhere I can find -- maybe for a reason.
25 years with DesignCAD