Commands for Pipe with code

Commands for Pipe with code

rocco.mayr
Enthusiast Enthusiast
817 Views
4 Replies
Message 1 of 5

Commands for Pipe with code

rocco.mayr
Enthusiast
Enthusiast

In this post I found how a pipe could be created with code:

https://forums.autodesk.com/t5/fusion-360-api-and-scripts/use-textcommands/m-p/9645688 

 

There are some commands shown in the script:

def initPipe(path):

    sels :adsk.core.Selections = _ui.activeSelections
    sels.clear()
    sels.add(path)

    txtCmds = [
        u'Commands.Start PrimitivePipe', # show dialog
        u'Commands.SetDouble SWEEP_POP_ALONG 1.0', # input distance
        u'Commands.SetDouble SectionRadius 0.5', # input radius
        u'NuCommands.CommitCmd' # execute command
    ]
    
    for cmd in txtCmds:
        _app.executeTextCommand(cmd)

    sels.clear()

Where could I find the other commands for setting up the pipe - like "Commands.SetDouble SectionRadius 0.5"?

 

0 Likes
Accepted solutions (2)
818 Views
4 Replies
Replies (4)
Message 2 of 5

rocco.mayr
Enthusiast
Enthusiast

Now I found it out. You will find the commands if you open Fusion 360. On the bottom open the menu "TEXT COMMANDS". Then click on Solid -> Create -> Pipe. Click on the pipe menu and then enter on the "TEXT COMMANDS" menu the command:

"Toolkit.cmdDialog"

 

Here is the output from today:

====>  CommandDialog:PrimitivePipePanel-0
Path, eSelectionButton, Label=Path, 1 selected
SWEEP_CHAINING_OPTION, eCheckBox, Chain Selection
SWEEP_POP_ALONG, eDropDownEntry, Distance, 1.00
  MenuItems:
  MRUValueCommand, eDropDownItem, 1.00
  MRUValueCommand, eDropDownItem, 0.034
  MRUValueCommand, eDropDownItem, 2.40
  MRUValueCommand, eDropDownItem, 0.40
  MRUValueCommand, eDropDownItem, 0.00
SWEEP_POP_AGAINST, eDropDownEntry, Distance, 0.00
  MenuItems:
  MRUValueCommand, eDropDownItem, 0.00
  MRUValueCommand, eDropDownItem, 1.00
infoSectionType, eDropDownButton, Label=Section, Circular
  MenuItems:
  infoCircular, eDropDownItem, Circular
  infoRectangular, eDropDownItem, Square
  infoTriangular, eDropDownItem, Triangular
SectionRadius, eDropDownEntry, Section Size, 11.338 mm
  MenuItems:
  MRUValueCommand, eDropDownItem, 24.00 mm
  MRUValueCommand, eDropDownItem, 24 mm
  MRUValueCommand, eDropDownItem, 5.00 mm
  MRUValueCommand, eDropDownItem, 2.125 mm
  MRUValueCommand, eDropDownItem, 1.125 mm
  MeasureCommand, eDropDownItem, Measure
  Reanchor, eDropDownItem, Re-anchor
SectionThickness, eDropDownEntry, Section Thickness, 2.835 mm
  MenuItems:
  MRUValueCommand, eDropDownItem, 4.00 mm
  MRUValueCommand, eDropDownItem, 6.00 mm
  MRUValueCommand, eDropDownItem, 1.25 mm
  MRUValueCommand, eDropDownItem, 0.531 mm
  MRUValueCommand, eDropDownItem, 0.281 mm
  MeasureCommand, eDropDownItem, Measure
PIPE_HOLLOW_OPTION, eCheckBox, Hollow
infoBooleanType, eDropDownButton, Label=Operation, New Body
  MenuItems:
  infoJoinType, eDropDownItem, Join
  infoCutType, eDropDownItem, Cut
  infoIntersectType, eDropDownItem, Intersect
  infoNewBodyType, eDropDownItem, New Body
  infoNewBodyInNewCompType, eDropDownItem, New Component
0 Likes
Message 3 of 5

kandennti
Mentor
Mentor
Accepted solution

Hi @rocco.mayr .

 

There's more to it.
I couldn't find it for a long time, but I found a way to change the "eDropDownButton" and described it here.

https://forums.autodesk.com/t5/fusion-360-api-and-scripts/use-textcommands2/m-p/10267986#M13156 


I'll let you know in advance.
The TextCommands specification is deprecated by Autodesk.
There is very little information available, and if it is wrong, it will often crash.
It is very difficult to develop and the processing speed is slow.
If you don't have any problems with it, I recommend you to use Sweep.

0 Likes
Message 4 of 5

rocco.mayr
Enthusiast
Enthusiast

Yes you're right with the other commands it even works for the SectionType. But with the Hollow option I still struggle:

 

infoBooleanType = 'infoNewBodyType'
u'Commands.SetString infoBooleanType {}'.format(infoBooleanType)
#PIPE_HOLLOW_OPTION

 

With this command the pipe doesn't get hollow. 

So I tried different Commands:

 

u'Commands.SetBool infoBooleanType {}'.format('true')
u'Commands.SetString infoBooleanType {}'.format('true')
u'Commands.SetBool PIPE_HOLLOW_OPTION {}'.format(infoBooleanType)
u'Commands.SetString PIPE_HOLLOW_OPTION {}'.format(infoBooleanType)

 

But no success, not getting hollow. Using 'PIPE_HOLLOW_OPTION' gives an error. Do you have an idea?

 

 

0 Likes
Message 5 of 5

kandennti
Mentor
Mentor
Accepted solution

@rocco.mayr .

 

I checked it out.

# check ON
Commands.SetBool PIPE_HOLLOW_OPTION 1

# check OFF
Commands.SetBool PIPE_HOLLOW_OPTION 0


I am trying the text command with the dialogs displayed, because running it in a script is a lot of work.