News:

Please note new Forum URL: forum.designcad.com

Main Menu
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.

Combine hatch points

Started by adriank, May 19, 2010, 10:17:51 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Rob S

Quote from: Pearco on May 20, 2010, 04:31:18 PM
Rob;

Trolls have human traits. Note the senior moments.


Yeah, well I hope I'll be doing so well when I get to be 548  ;D
User since forever

bdeck

#16
Quote from: Lar on May 19, 2010, 02:33:49 PM
But tell me something... how do you combine the points so you can delete them as one?

Lar,

In point select mode it is easy to do a drag select on a group of points.

Then you can delete them using the follwing macro.

(I had the same question a couple years ago. Thanks Prl.)

BD




>DeletePoints
{
}
end

Adrian 2.0

I have to say that before this I had NEVER used the command line - I hate typing when I can point & click. DCad point & clicks so well, so..... I had re-assigned the spacebar as my delete key (now, that's a key I use ALL the time).
I have now re-assigned a different key (F12) as the command line & because I don't use it for anything else it defaults to 'deletepoints' every time I open it.
The sequence is now so simple & quick:
1-Drag-select the points
2-F12
3-enter
This has to be my best 'find' since I found DCad!
Saint Rob, I plan to organize a pilgrimage to your birthplace, burning candles, incense, the whole 9 yards.

Where is that? Anywhere near 'Graceland'?

Lar

I came across the >DeletePoints command some time ago while researching something else but in my haste, at that time, I somehow got the impression the points had to be selected by the macro, which can get very confusing, so I put off checking it out fully. I wasn't aware that the command could simply be typed in the command line after selecting points manually.

There are a few point macro commands but they are scattered throughout the macro help file because the name normally ends in 'point' so it's difficult to search alphabetically and 'point' is so common that using the index is too helpful. Most of what you can do in point select mode with the mouse you can do in a macro but they are complicated by the fact that points have to be set near a line or near a segment of a line. Also the line must be selected. If the macro selects the wrong line imagine what can go wrong.

Lar
ps: losing prl was a great lost to this forum...  :'(

Rob S

QuoteI plan to organize a pilgrimage to your birthplace, burning candles, incense, the whole 9 yards.

Where is that? Anywhere near 'Graceland'?

It'll be a bit of a hike, you might prefer deleting those points one at a time!!!

I was first seen in Northern BC in a place called Smithers, which is 1200 km by road from Vancouver, and we had no electricity on our farm, so I have more familiarity with candles than most.

User since forever

bdeck

#20
Quote from: Lar on May 19, 2010, 02:33:49 PM
But tell me something... how do you combine the points so you can delete them as one?

Oops,

In playing around more with deletepoints, i notice that it has some odd behaviors when the selected points belong to more than one entity, or when no entities are selected.

It will first delete the selected points from one entity. Then if you run the macro again, it may delete the selected points from the other entity, or it may delete the last single point from the first entity drawn without a selected point, whether that entity is selected or not.

The first drawn entity will change to the last drawn entity when a point is removed from it. So every time the command executes it removes a point from a different entity.

I dont see any way that this can be good.


I vote for fixing the command so that it deletes all selected points at once, regardless of entity, or add a parameter to the command to force deletion of points from multiple entities.

If no points are selected, my vote is that it do nothing, or add a parameter to make it do nothing if no points are selected, or add a sys() variable so that the macro can check the number of selected points.

Edit 5/22/10  Using this command properly within a macro seems to avoid these problems. See post below.

BD

PS, I tested this in version 17.2.  I dont have the later versions at my office.

PPS, The discovery by RobS that the macro command can be entered directly from  the command line is very cool.  

bdeck

#21
One more item I noticed.

If you have multiple polylines selected, and points selected on each of them, the first execution of DeletePoints will delete the selected points from one of the lines.

If you then move the remaining selected points with the cursor, then the  next execution of DeletePoints will delete the selected points from one of the other lines.

etc.

Edit 5/22/10  The Macro below appears to fix this problem using the SetSelectedPoints command to keep the point buffer current.

BD

Lar

#22
Like I was saying...

Quote from: Lar on May 21, 2010, 07:22:50 AM
...
Most of what you can do in point select mode with the mouse you can do in a macro but they are complicated by the fact that points have to be set near a line or near a segment of a line. Also the line must be selected. If the macro selects the wrong line imagine what can go wrong.
...

Bd, I remember coming across a macro command that highlights points but I can't find it (see my previous post). Your macro may have to select a single line, highlight points, delete them then move on to another line. You would also have to make sure the selected item is not part of a group or solid. The safest method, in my opinion, is to manually do the selections then use the command line or the simple macro you posted earlier.

Remember that dcad don't allow things like adding or deleting points when more than one entity is selected.

Lar

bdeck

#23
Quote from: Lar on May 21, 2010, 05:09:20 PMThe safest method, in my opinion, is to manually do the selections then use the command line or the simple macro you posted earlier.

Hi Lar,
That is how I found the above features in the DeletePoints function.

My version of DC allows moving and deleting, but not adding points on multiple selections. ( I still use 17.2 ) It even allows deleting points from grouped objects. But after the first deletion the deletepoints function crashes, unless a point is reselected. Moving or deleting individual points is no problem.

BD



bdeck

#24
Here's a first draft that seems to work
(Actually it's the first draft that seems to work after many failures.)

It seems that SetSelectedPoints is the critical command that I had been ignoring.
When executed prior to the DeletePoints command, it prevents deletion when no points are selected, even from the command line... sometimes. Mostly SetSelectPoints crashes DC when run from the command line.

BD

Note: This draft is slightly more verbose than necessary to allow optional branch logic after first point deletion.


' dp.d3m                         BDeck          5/10
'
' Macro to Delete Points from one or multiple entities.
'
' Select entity (or entities).
' In point select mode, select some points on the selected entities.
' Run macro.
'
' After point selection, take care not to inadvertently select more entities that might share the same points.
'

If Not Sys(345) Then
    Message "Not in point select mode"
    end
endif
ns=sys(80)
If ns < 1 Then
message "No entities selected"
End
endif
setselectedpoints    'buffer the preselected points so that  sys(1) and pointval will work correctly
np=sys(1)
If np < 1 Then
message "No points selected"
End
endif

npp=np+1
dim x(npp), y(npp), z(npp)

for i=1 to np         'archive the selected points
pointval x(i), y(i), z(i), i
next i

>DeletePoints            ' Delete points from one entity only
{
}

do while ns > 1          ' If more entities are selected, try to delete points from them too.

       for i=1 to np
          >DragSelect               ' Reselect any points that remain
   {  
               <type 1          
               <Pointxyz [x(i), y(i), z(i)]
               <Pointxyz [x(i), y(i), z(i)]  
   }
next i
setselectedpoints 'buffer the points selected above by dragselect function

if sys(1)<1 then exit do            ' loop until dragselect fails to find any points
>DeletePoints
{
}
loop

' REGEN     'optional (probably necessary in 3D)
end


Here's the sleek, slippery, stripped down version:

' dp.d3m            v02                      BDeck          5/10
'
' Macro to Delete Points from one or multiple entities.
'
' Select entity (or entities).
' In point select mode, select some points on the selected entities.
' Run macro.
'
' After point selection, take care not to inadvertently select more entities that might share the same points.
'
If (Not Sys(345)) or (sys(80)<1) Then end       'must be in pointselectmode with ents selected

setselectedpoints    'buffer the preselected points so that  sys(1) and pointval will work correctly
np=sys(1)
npp=np+1
dim x(npp), y(npp), z(npp)

for i=1 to np              'archive the selected points
pointval x(i), y(i), z(i), i
next i

do while sys(1)>0           ' loop until dragselect fails to find any points
>DeletePoints
{
}
for i=1 to np
  >DragSelect             ' Reselect any points that remain
 {  
<type 1          
  <Pointxyz [x(i), y(i), z(i)]
<Pointxyz [x(i), y(i), z(i)]  
  }
next i
SetSelectedPoints  'buffer the points selected above by dragselect function
loop
end

bdeck

#25
Quote from: Lar on May 21, 2010, 05:09:20 PM
You would also have to make sure the selected item is not part of a group or solid.

Hi Lar,

Using the expanded macro to delete points from groups does not seem to be a problem, but as you pointed out, solids are just not suitable targets for DeletePoints.

Filtering out solids is a possibility, but then there are groups containing solids. And the macro makes a total mess of surface connect grids.

It hurts my brain to think about it.

I'll use it on hatches, polylines, and curves, almost exclusively in 2D, where it is only marginally more useful than the command line function. This was primarily a programming exercise to see if it could be done. I dont recall ever needing to delete points from multiple entities or groups. But I'm curious if it has any real application for others. Perhaps the boundary between two hatches, or between a curve or polyline and a hatch fill.

BD

PS:  It was largely the help I got from you and Prl on this forum that made it possible for me to make a (relatively smooth) transition from DC6 to DC13 many years ago. It hurts my brain also to think how things might have gone if you (and others) had not been so selfless.

But my brain will survive, 'cause the Celtics are up by 23 in game 3.   ;D


Lar

It's gonna be an ol' skool classic: Lakers vs Celtics

Lar

bdeck

Ol' skool indeed.

Dunno how they'll match up, but it will be fun to watch.

BD


bdeck

#28
Quote from: adriank on May 21, 2010, 04:38:00 AM... before this I had NEVER used the command line - I hate typing ....

One final alternative:

If you want to use the DeletePoints command from the command line, but don't like typing or using the dropdown listbox, you can add the following line to your custom.ini file:

"pd=ID_DELETE_POINTS"

Now typing "pd" will have the same effect as typing "deletepoints".

("pd" is an example; you can use any name that isnt already taken in the custom.ini file or the macrocmd.ini file.)

BD

Dr PR

Of course you can also assign a macro to a key in the keyboard definitions file, so then you don't have to type much at all.
DesignCAD user since 1987