Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
AlexFielder
in reply to: wayne.brill

Hi Wayne,

 

That's great, thanks.

 

I did solve this using the method I described earlier in the thread such that the tool now runs as so:

 

  1. The user clicks the ribbon button
  2. The user waits whilst Excel opens and collects the necessary data - I may swap Excel for something else (json or XML perhaps); it depends on the customer really.
  3. The user selects an exterior Cylindrical surface (outside of the tube)
  4. The user selects an interior Cylindrical surface (inside of the tube)
  5. The user selects a tangential work plane
  6. The user selects a work axis to drive the "X" direction

Once these selections are in place, the code continues by making a sketch containing our 2D locations, before creating a 3D sketch and then firing the built-in Wrap to Surface command. Once that happens the code waits for the user to select the Wrap to Surface option and click continue (as per your earlier suggestion, so thanks for that!).

 

With this selection complete and the necessary inputs filtered to our SelectSet, Inventor creates the resultant 3D Sketch points that retain a "normal" link (albeit without the exposed ReferencedEntity information) to the original 2D Sketch.

 

When this is complete we quickly create the same transient points ourselves and then run a comparison between each 3D Sketch point geometry and the transient point (within a tolerance) to determine which hole goes where.

 

Once the comparison is complete, a series of work points and normal-to-surface work axes (at those points) are created, renamed and stored for later use by the hole creation method.

 

Overall, I'm really happy with the resultant tool-set.

 

As a worst-case stress test I built a spreadsheet that allowed me to create 500 holes using this tool in around 30-35 minutes. I think that could probably be sped up by removing a few view.updates I have dotted around though. (Unless you have a better suggestion?)

 

The difficulty in doing that is that the user may be inclined to think that Inventor has stopped responding if there's no on-screen activity for an extended period.

 

One thing I'm not checking for currently is a situation where the X position value (from 0) of any hole is greater than the circumference of the destination cylindrical face; I'm pretty sure that the Wrap to surface command supports this but from the limited testing I have carried out so far, the transient geometry method I have (drawing an arc with an angle) doesn't allow you to have an arc whose angle is > 360°. And frankly why should it.

 

Thanks again,

 

Alex.