|
![]() |
#1 |
Junior Member
Member
Join Date: Jan 2018
Posts: 24
|
![]()
Hi,
I'm just starting with scripts. I've managed to select things by name, rotate, export and so on. I'm now trying to use the knife and I see a syntax I can't follow where the command is followed by "user command". How does this work please? I tried selecting the object to use as a knife and then did "ac3d ddhknife" but that didn't work. Also I'm struggling to work with internal object_id's. How can I obtain them? I don't see anything in the .AC file that looks like an object_id and I can't seem to list them. If I make something, say "new_cube" it doesn't return a value as an object_id. Finally I'd rather find out the answers to these things myself than impose on others, though Andy has been very kind and helpful, so is there more documentation anywhere? I have a list of all the AC3D commands and the arguments they take but nothing more than that. Phil |
![]() |
![]() |
![]() |
#2 |
Junior Member
Member
Join Date: Jan 2018
Posts: 24
|
![]()
UPDATE: I discovered that ddhknife was actually working. I presumed it hadn't because after I'd run the script I opened the dialogue box expecting it to show the knife object I'd set it to, but the dialogue was blank. However I run the ddhknife_go function and all was well.
However... it doesn't cut meshes very well. I tried to cut a mesh with a block and got this. zoomed in.. What I have found works well instead is boolean knife and cut away, however I can't work out how to run that with a script. I've tried knife-and-cut-away, knife_and_cut_away, knife+cut-away etc etc. Anyone? |
![]() |
![]() |
![]() |
#3 |
Administrator
Professional user
Join Date: Jun 2003
Posts: 4,525
|
![]()
doing an "ac3d list" command via a telnet window gives the list of commands and one is:
boolean <subtract, union or intersect> "perform a boolean operation" In a script, you'll need to select one object e.g. objectA, then another e.g. objectB and then submit the command "ac3d boolean subtract" which should perform objectA-objectB. To find out more about how the internal commands are used, have a look in the tcl files (in the tcl subdirectory). If you look in the hierarchy tcl file, you'll see commands that work with object ids. If you are a coder, it's relatively easy to add extra commands via a plugin. There are currently no commands to construct a object (e.g. create-object, add-vertex, add-surface etc.) but they could be added. They could be rather dangerous ![]() |
![]() |
![]() |
![]() |
#4 |
Junior Member
Member
Join Date: Jan 2018
Posts: 24
|
![]()
Thanks Andy. boolean subtract doesn't work on a mesh, it says it only works on 3d objects, so what I need is boolean "knife-and-cut-away" but I can't work out what argument to use as "knife-and-cut-away" isn't recognised.
I've done the ac3d list but I only get this line: boolean <subtract, union or intersect> "perform a boolean operation" Does that mean boolean knife-and-cut-away isn't a scripted option? If it is an option can I find out what arguments are accepted? |
![]() |
![]() |
![]() |
#5 |
Administrator
Professional user
Join Date: Jun 2003
Posts: 4,525
|
![]()
Have a look in tcl/ac3dmenu.tcl - you'll see all the commands attached to the menu items.
|
![]() |
![]() |
![]() |
#6 |
Junior Member
Member
Join Date: Jan 2018
Posts: 24
|
![]()
Fantastic ! This is great documentation. For anyone else its "knifecut" as per
$menubar.object.menu add cascade -label "Boolean" -menu $menubar.object.menu.boolean menu $menubar.object.menu.boolean -tearoff 0 $menubar.object.menu.boolean add command -label "Subtract" -command "ac3d boolean subtract" $menubar.object.menu.boolean add command -label "Intersect" -command "ac3d boolean intersect" $menubar.object.menu.boolean add command -label "Union" -command "ac3d boolean union" $menubar.object.menu.boolean add command -label "Cut Away" -command "ac3d boolean cut" $menubar.object.menu.boolean add separator $menubar.object.menu.boolean add command -label "Knife" -command "ac3d boolean knife" $menubar.object.menu.boolean add command -label "Knife and Cut Away" -command "ac3d boolean knifecut" |
![]() |
![]() |
![]() |
#7 | |
Junior Member
Junior member
Join Date: Mar 2018
Posts: 2
|
![]()
Hi Andy,
I'm going to hijack Spitforty's thread a bit, cause we are kind of looking at the same thing over at the Aerofly/IPACS forum. I've been reading a bit about the scripts on this sub forum, and I keep seeing references to telnet and shell sessions: Quote:
Also, is there a bit more detailed doco on each tcl function, maybe part of the SDK? I have a list of commands, but I'm a little bit unsure what arguments they take. Thanks in advance, coffeecup |
|
![]() |
![]() |
![]() |
#8 |
Administrator
Professional user
Join Date: Jun 2003
Posts: 4,525
|
![]()
Sorry, the commands are self-documenting
![]() The best way to find out what the parameters mean is to look at the tcl code that calls AC3D - mostly in the menu code in tcl/ac3dmenu.tcl. If you can't work something out - let me know. It's easy enough to make a script which pops up a window which say a list of button in it. Pressing the buttons can run one or more command. There may be some examples on here... |
![]() |
![]() |
![]() |
#9 |
Administrator
Professional user
Join Date: Jun 2003
Posts: 4,525
|
![]()
Here's a an example, which you might also find quite handy for the Aerofly stuff:
https://www.inivis.com/supercoldmilk...quickgrid.html |
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|