Itoo Software Forum

Author Topic: Build Button by maxscript  (Read 1326 times)

PU1548

  • Newbie
  • *
  • Posts: 17
Build Button by maxscript
« on: August 03, 2020, 12:11:29 PM »
Hi

Using mxscript is possible  to build   RailClone  when auto update is off?

Rokas

  • Hero Member
  • *****
  • Posts: 3324
Re: Build Button by maxscript
« Reply #1 on: August 03, 2020, 01:54:28 PM »
Hi
Not directly. You need to enable autobuild, and then disable it again.
Example script to refresh all RailClone objects(where autobuild was disabled) in the scene:

Code: [Select]
for each in (for obj in geometry where classof obj == RailClone_Pro and obj.autoUpdate== false collect obj) do (each.autoUpdate=true ; redrawViews();each.autoUpdate=false)
Rokas

PU1548

  • Newbie
  • *
  • Posts: 17
Re: Build Button by maxscript
« Reply #2 on: August 03, 2020, 04:25:35 PM »
Thanks    yes  I think this solution too..     

RB2300

  • Newbie
  • *
  • Posts: 47
    • DEVconstruction
Re: Build Button by maxscript
« Reply #3 on: March 21, 2022, 08:24:41 AM »
Please guys,

how can i make this works?

for each in (for obj in geometry where classof obj == RailClone_Pro and obj.autoUpdate== false collect obj) do (each.autoUpdate=true ; redrawViews();each.autoUpdate=false)

I updated geometry, then selected RC object and process this script and I dont see update....
Please how can I make it works? I need that "build" command please

Best regards P.

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2991
Re: Build Button by maxscript
« Reply #4 on: March 21, 2022, 09:24:41 AM »
Hi,

Does the RailClone object update correctly if you do it manually? I just want to check if it's an error with the script snippet or some other issue.

Thanks,
Paul
Paul Roberts
iToo Software

RB2300

  • Newbie
  • *
  • Posts: 47
    • DEVconstruction
Re: Build Button by maxscript
« Reply #5 on: March 21, 2022, 11:36:31 AM »
Hello Mr Paul, it works manually through (railclone control menu click on BUILD button works), but through that script no.

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2991
Re: Build Button by maxscript
« Reply #6 on: March 21, 2022, 02:58:50 PM »
It seems to be working fine here:



Before you hit return, please make sure the cursor is on the same line as the script. I found I was on the next line and it wasn't working.

Cheers,

Paul
Paul Roberts
iToo Software

RB2300

  • Newbie
  • *
  • Posts: 47
    • DEVconstruction
Re: Build Button by maxscript
« Reply #7 on: March 25, 2022, 08:55:48 AM »
Thank you Mr Paul,
Your stuff works but doesnt work with groups...

) you create lets say box and then group it ...
) then you create RC ....  and open group and assign group to the RC
---- now you have box on spline ----
) then you add new box/object to the group (and RC will not show a new object)...

 then you try your command line and it not update the new shape.... 
only what works is that manually click on build in RC menu.

Please is there any solution that i can assign shortcut from maxscript on build/rebuild RC?

NOTE: These groups are really good update in RC.. .I would like say super really good... unfortunately, that rebuild is doesnt work


NOTE: Guys you did "super great" job with last update "lights + groups" It is supper super super new update,
If I could say my opinion, last think what should be really super super handy and super great is if you could in new version let us allow add object and allow somehow subtract it for creating holes in the walls for windows/doors and other needs then I would say it has everything...

Why this? Because at the moment there is problem with materials...
If i duplicate RC and then try intersect/subtract holes, then at end of the day I dont have materials because material in RC are as a "segment material" and if i copy/reference it and substract then I will loose all materials.
And, I dont know how to go around this, I think there is no solution to relink RC material into new object. that is copied/referenced and intersected..... I i could somehow redirect materials from RC to the new object it would solve problem but I didnt find any script that will allow my copy RC generated material into new object
If there is any alternative solution for intersection I am more then happy hear the solution

Best regards Pablo

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2991
Re: Build Button by maxscript
« Reply #8 on: March 25, 2022, 12:37:03 PM »
Hi Pablo,

Thanks for your reply. I can reproduce the groups issue and I'll pass it on to our developers. IN the meantime a hacky workaround might be to try to following script

Code: [Select]
for each in (for obj in geometry where classof obj == RailClone_Pro collect obj) do (SeedTemp = each.seed; each.seed=SeedTemp+1; each.seed=SeedTemp)
It works by changing the random seed and then changing it back to its original value which forces a rebuild.

Regarding your booleans suggestion, have you tried using the clipping modes available in the A2S and L1S generator. They can be used quite effectively to cut holes in the array. Check out the clipping section in our documentation for more info: https://docs.itoosoft.com/railclone/style-editor/2d-arrays-generator-a2s

Cheers,

Paul
Paul Roberts
iToo Software

RB2300

  • Newbie
  • *
  • Posts: 47
    • DEVconstruction
Re: Build Button by maxscript
« Reply #9 on: March 27, 2022, 08:36:58 PM »
Goof afternoon Mr Paul,
///// SCRIPT REFRESH RC
your updated command regard refresh RC works perfectly thank you really much, I really appreciate it, it is really handy.

///// BOOLEANS
I downloaded railclone_tutorial_next_steps_exercises.zip and I am really impressed, and I see how it works in yoiur examples.
Thanks for pointing this, I didnt know that this exist in RC :D
Regard my project, unfortunately I cannot use it because I am trying generate RC walls for all house and these X or Y or Z limitations it cutting through the all walls.
Another solution is to set the ID LIMIT. It looks for me lot of work create for each opening specific ARRAY2S. I need think about it how to approach to this.

Anyway maybe in in future, if there would be something like this https://www.kinematiclab.com/products/multimesher
that you can attach to the main "RC modify panel" some booleans that will affect that RC... and it will automatically booleans where you position it, it would more easy. Anyway I really appreciate that RC has already "clipping" solution.

Thank you so much Mr Paul for your last message