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.

PerpendicularTo{ <SelectOnly } fails

Started by bdeck, November 28, 2008, 03:59:03 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bdeck

In the PerpendicularTo command:

The "<selectonly 0" parameter  fails. (Noticeable if SelectOnly flag has previously been set, and sys(80)>0).

Also "<selectonly 1" fails. (Noticeable if SelectOnly flag has not been previously set, and sys(80)>0).

See demo in later post.

BD




code removed from this post in favor of demo in later post in this thread



paulerens

#1
Bdeck, test this first.
This is your code
pertest.d3m

dim x(5), y(5), z(5)
'NE=sys(9)           ' no of entities
sys(1) = 0           ' no of points set
 
Setpoint "Set 3 points for  1) arc center, 2) starting point, 3) direction, 4) end angle", 2

If Sys(1) < 2 Then end

for j = 1 to 2                 
     pointval x(j), y(j), z(j), j             'store point values
next j

sys(36)=1

>Perpendicular To
{
   <SelectOnly 0
   <Pointxyz [x(1), y(1), z(1)]
   <Pointxyz [x(2), y(2), z(2)]
}
print sys(9),ne
if ne = sys(9) then
     message "failed"
else   
     anykey
endif


Determine now the second point of the celected line ,for the end of your arc.
This is the point determined by > Perpendicular To
<Pointxyz [x(2), y(2), z(2)]is the point to finde point 2

Paul

bdeck

#2
Quote from: paulerens on November 28, 2008, 06:28:59 PM
'NE=sys(9)           ' no of entities


Hi paul,

Today, retesting this same code, I cannot duplicate the error.

I'll repost when I get more info.


BD


bdeck

Hi Paul, etal,

Here's the problem.

If you set the "SelectOnly" flag in the Extend command using "<selectonly 1", you cannot turn it off in the PerpendicularTo comand using "<selectonly 0".

A hack shown below will fix the bug.

Comment out the hack line, and preselect a line or two to see what happens without the hack.




'perp2.d3m, bdeck  11/08,  demo to show bug in SelectOnly parameter

dim x(5), y(5), z(5)
ne=sys(9)        ' no of entities
sys(1) = 0        ' no of points set
sys41=sys(41)            ' archive rubberband type
sys242=sys(242)                  ' archive status of select-when-created flag
sys(41)=0        ' rubberband optional

Setpoint "Set 3 points to draw:    1), 2)  first line, 3) perpline",3

If Sys(1) < 3 Then goto cleanup

for j = 1 to 3                   
  pointval x(j), y(j), z(j), j             
next j

sys(36)=1
sys(242)=1         'turn on select at creation

>line
{
<Pointxyz [x(1), y(1), z(1)]
<Pointxyz [x(2), y(2), z(2)]
}

>Extend
{
<SelectOnly 1                        ' This line turns on the flag 
<Pointxyz [x(2), y(2), z(2)]       
<Pointxyz [x(3), y(3), z(3)]
}

>selectprevious        ' (deselect the extended line)
{
}

>Extend                             ' turn off select only flag                           
{
       <SelectOnly 0         'without this hack, "<SelectOnly 0" below will fail
       <Null
}

sys(242)=0         'turn off select at creation

>PerpendicularTo
{
<SelectOnly 0                     ' This parameter fails
<Pointxyz [x(3), y(3), z(3)]
<Pointxyz [x(1), y(1), z(1)]
}

if sys(9)<ne+2 then
       print "sys(9)",sys(9),"ne",ne
       message "failed"
endif

cleanup:

sys(242)=sys242
sys(1) = 0       
sys(41)=sys41     

end

paulerens

Hi bdeck,
The same problem in parallel
you can turn <SelectOnly  on or off in a macro without effect.
The result is that what was indicated last, manually.

bdeck

#5
Quote from: paulerens on December 02, 2008, 04:40:30 PM
The same problem in parallel
you can turn <SelectOnly  on or off in a macro without effect.

Hi Paul,

Good point.

The Extend command will alter the SelectOnly status for the macro Parallel command also. (tested in v17.2)

I haven't tested any of the other commands.

Another challenge for the indefatigable DT.

BD



paulerens

Hi BD,

Surprising it works!
The parallel <Select Only = 1 also works with your system.

Like coconuts searching with a sheepskin.

Paul