Author Topic: mirror failure in silent mode  (Read 1120 times)

bdeck

  • Hero Member
  • *****
  • Posts: 827
mirror failure in silent mode
« on: May 08, 2015, 08:58:40 AM »
In DC version 24 (not 3d max) silent mode causes the mirror function in the following macro to malfunction (it creates a duplicate version of the selected entity on top of itself, instead of mirroring it)

The marco worked fine in prior versions of DC 3D Max.

The macro works fine in DC v24 if sys(36) line is commented out.

Any ideas? Any other commands fail in silent mode?

Thanks,
bd

Code: [Select]
cm6.d3m,   Mirror replacement macro  BDeck  4/08
' Custom Mirror
' Similar to mirror command in version 6.
' Allows using shift key while setting second point for orthagonal custom mirror.
' Eliminates dialog box.

' All instructions appear in status bar.

sys(470)=1     'block other commands
sys41=sys(41)  'archive rubber band mode
ns=sys(80)     ' get number of selected entites

if ns=0 then end

gosub clickline

sys(41)=sys41   'cleanup restore rubber band mode

end

clickline:
   Sys(41) = 1 'rubberband line for user points
   Setpoint "Set two points do define custom mirror", 2
   If Sys(1) < 2 Then return
 
   sys(36)=1   ' Set silent mode for duration of macro.  This line causes macro to fail in DC 24

   Pointval x1 y1 z1 1 ' get the first point the user set
   Pointval x2 y2 z2 2 ' get the second point the user set
 
  >Mirror
  {
  <Axis 4  ' 4 = custom mirror]   Thanks to prl for documenting this parameter
  <Type 1  ' 0 = don't make copy , 1 = make copy   
   <Pointxyz [x1,y1,z1]
   <Pointxyz [x2,y2,z2]
  }
return    ' OP had inadvertently omitted this line
« Last Edit: May 09, 2015, 04:40:00 AM by bdeck »

DrollTroll

  • Kindly Curmudgeon
  • Administrator
  • *****
  • Posts: 4191
Re: mirror failure in silent mode
« Reply #1 on: May 08, 2015, 12:56:29 PM »
That's odd! First I've heard of it, thanks for pointing it out.

Dt
25 years with DesignCAD

Dempsey

  • Hero Member
  • *****
  • Posts: 1901
  • Intel i7-960, 12GB, NVidiaGTX570, Win7x64, DC26.2
    • World of van Vliet
Re: mirror failure in silent mode
« Reply #2 on: May 08, 2015, 02:55:50 PM »
bdeck,

I added two lines at the end of your macro and it works fine for me:
Code: [Select]
' cm6.d3m,   Mirror replacement macro  BDeck  4/08
' Custom Mirror
' Similar to mirror command in version 6.
' Allows shift key for custom mirror.
' Eliminates dialog box.

' All instructions appear in status bar.

sys(470)=1     'block other commands
sys41=sys(41)  'archive rubber band mode
ns=sys(80)     ' get number of selected entites

if ns=0 then end

gosub clickline

sys(41)=sys41   'cleanup restore rubber band mode

end

clickline:
  Sys(41) = 1 'rubberband line for user points
   Setpoint "Set two points do define custom mirror", 2
   If Sys(1) < 2 Then return
 
   sys(36)=1   ' Set silent mode for duration of macro.  This Line Fails causes macro to fail in DC 24

   Pointval x1 y1 z1 1 ' get the first point the user set
   Pointval x2 y2 z2 2 ' get the second point the user set
 
  >Mirror
  {
  <Axis 4  ' 4 = custom mirror]  ' Thanks to prl for documenting this parameter
  <Type 1  ' 0 = don't make copy , 1 = copy   
   <Pointxyz [x1,y1,z1]
   <Pointxyz [x2,y2,z2]
  }
   sys(36)=0   ' Set silent mode for duration of macro.  This Line Fails causes macro to fail in DC 24
  return

Dempsey

DrollTroll

  • Kindly Curmudgeon
  • Administrator
  • *****
  • Posts: 4191
Re: mirror failure in silent mode
« Reply #3 on: May 08, 2015, 03:04:21 PM »
Dempsey are you testing in 3D Max 24? It only fails in the 2D version, not 3D Max.
25 years with DesignCAD

bdeck

  • Hero Member
  • *****
  • Posts: 827
Re: mirror failure in silent mode
« Reply #4 on: May 08, 2015, 05:12:41 PM »
I added two lines at the end of your macro and it works fine for me:

Hi Dempsey,

Oops. My cut and paste somehow failed to include the return line.  I've fixed it in the OP.
In my 3d max versions through v23, the macro worked fine with the proper return line, and with or without the resetting sys(36) to 0. As DT mentioned, only in the basic v24 did the macro fail. But it runs fine even in that version if it does not set sys(36) to 1.

Thanks,
bd





Dempsey

  • Hero Member
  • *****
  • Posts: 1901
  • Intel i7-960, 12GB, NVidiaGTX570, Win7x64, DC26.2
    • World of van Vliet
Re: mirror failure in silent mode
« Reply #5 on: May 08, 2015, 08:49:15 PM »
DT, bdeck,

Oops, I am sorry, I indeed tested in 3D Max version of 24.1.
Dempsey