News:

Please note new Forum URL: forum.designcad.com

Main Menu

Select Last routine

Started by prl, May 12, 2013, 02:54:37 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

prl

I notice when doing solid operations, DesignCAD doesn't have a select last command.  Example, you do a solid subtract and DesignCAD does the operation but for some reason you can't select the entity.  The reason being DesignCAD created the entity and put some of the pieces on invisible layers.  This routine will select the last entity created.  This includes solids (which are compound entities).  Once selected, even with portions of the selection on invisible layers, the user can use the infobox to fix layers, colors, materials, etc.  Or the famous infobox same-as finger.  Or drag-copy, drag move . . . etc. anything you can normally do with a selection.

'Program: slast.d3m (select last)

'Selects the last item created
'5/12/2013

'Purpose: useful when DC creates a solid with portions of it on an invisible layer.  The program
'         works on the last created item which may be a compound entity (such as a solid).  Once
'         selected, the user can use the infobox, or the same-as finger etc.             

'use this trick to record the entity count
sys(36) = 2
>eraselast
{
}
start = sys(9)

'put back the last erased item
>undo
{
}

'now select the last item created (may be a compound entity)
sp1=start+1
for j = sp1 to sys(9) 
  getattr j, type
  putattr j, type, 1
next j

sys(36) = 0 
regen
End


JJG

Many many thanks, Prl !!!

This goes much make our lives easier in the sense that it will not be necessary to find out why sometimes you can not select a Solid resulting of a solid-Subtract action !

Once again, many many thanks !!!
;)

minstrel

Another winner!  Thanks prl

...Slast, wasn't there a 'head-bangers' band with that name? If not, there will be.

Minstrel

prl