How to create a square pipe using PipeFeatures?

How to create a square pipe using PipeFeatures?

ph0en1x01
Contributor Contributor
592 Views
1 Reply
Message 1 of 2

How to create a square pipe using PipeFeatures?

ph0en1x01
Contributor
Contributor

I want to create a square pipe using PipeFeatures. But I am unable to find an example related to it.

0 Likes
Accepted solutions (1)
593 Views
1 Reply
Reply (1)
Message 2 of 2

kandennti
Mentor
Mentor
Accepted solution

Hi @ph0en1x01 .

 

The API does not provide a way to create pipe features.
I believe it is possible to create the same shape using sweeps.

 

If you really want to create a pipe feature, the only way is to use the text command.
By slightly modifying the initPipe function in the sample here, it is possible to create a square pipe.

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

def initPipe(path):

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

    txtCmds = [
        u'Commands.Start PrimitivePipe',
        u'Commands.SetDouble SWEEP_POP_ALONG 1.0',
        u'Commands.SetString infoSectionType infoRectangular',
        u'Commands.SetDouble SectionRadius 0.5',
        u'Commands.SetBool PIPE_HOLLOW_OPTION 1', 
        u'Commands.SetDouble SectionThickness 0.1',
        u'NuCommands.CommitCmd'
    ]
    
    for cmd in txtCmds:
        _app.executeTextCommand(cmd)

    sels.clear()

 

However, we recommend using sweeps.