Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Modify Holes

Anonymous

Modify Holes

Anonymous
Not applicable

Hello, I am trying to create a script to edit the parameters of an existing hole, I try to access it through its name in the example parameter list "Hole1".

 

I have been able to create the holes, but I cannot modify them. Can someone give me an idea ?

 

Thank you!

0 Likes
Reply
Accepted solutions (2)
643 Views
6 Replies
Replies (6)

goyals
Autodesk
Autodesk
Accepted solution

May be you can try something like this.

 

app = adsk.core.Application.get()

root = app.activeProduct.rootComponent

features = root.features

holeFeatures = features.holeFeatures

hole = holeFeatures[0]

diaParam = hole.holeDiameter

diaParam.value = 3.2



Shyam Goyal
Sr. Software Dev. Manager
0 Likes

Anonymous
Not applicable

Thank you very much goyals, I will start there !

0 Likes

Anonymous
Not applicable

Hello! First of all, to say that I don't know if it is correct to publish this here or elsewhere, I will do it where you indicate.

 

I am very interested in continuing studying .. I have managed to carry out various tests, create objects, etc.

 

Something that I can't do is, as in the previous case, with an existing hole, for example. vary its depth .. if the diameter, modify its name, add comments, etc.

 

Is there a book or study material that contains clear information about your programming?

 

Could you give me, as in the previous case, a basic example of how I modify the depth of an existing hole?

 

Thank you very much, I think this confinement is affecting me!

0 Likes

goyals
Autodesk
Autodesk

The good reference to learn is API documentation. Multiple samples are also provided here to get you started with initial code. http://help.autodesk.com/view/fusion360/ENU/?guid=GUID-DE98632B-3DC0-422B-A1C6-8A5A15C99E11

 

Some Fusion API concepts are explained also on https://modthemachine.typepad.com. I hope this will help. Take care.



Shyam Goyal
Sr. Software Dev. Manager
0 Likes

Anonymous
Not applicable

Hello, thank you very much for your answer !

 

Those links you passed me I have seen and studied a lot, hence I managed to perform many of the tests, along with "tapnair" work among others ..

 

What I can not find and even in these links that you passed me, is how to modify the depth of an existing drilling, if created from scratch but not existing.

 

I am programming and debugging with VSCode which is very helpful ..

 

I will continue investigating, if you have the opportunity to pass me an example of how the depth of the hole is handled, I would appreciate it!

 

Cheers

0 Likes

Anonymous
Not applicable
Accepted solution

Hello, thank you very much .. I already did it ..

 

It would be great if there was more and better information about this API. I have been programming for many years and after studying various things and debugging the code I managed to get to this ..

 

Regarding the help information, it is almost impossible to understand what parameters refer to a function.

 

We will continue studying!

 

Thank you so much !

0 Likes