AnsweredAssumed Answered

Issues with returning variant from function

Question asked by Harold Black on Dec 6, 2019

I'm creating a custom curve driven pattern and I have ran into a problem with returning a result from a function. Currently i'm writing code that will return me the parent plane of the extrusion that the curve driven pattern is on.


The end result of this macro will split my curve into equal segments and it will draw lines from the endpoints of these segments to the terminating plane in the same direction of the normal to the plane of the extrusion. These lines will be used to create weldments. Basically, I'm "adding" an option to the curve driven pattern tool that will allow me to pattern a feature/body along the curve, while keeping tangency of the feature/body while also maintaining the same alignment of the seed feature/body.


The way it works:

The user would run the macro and select the sketch segment for the curve. The macro then would pass the sketch segment into a function to find the parents of the sketch segment. It would go through these parents and look for an extrusion (since the curve is drawn on the face of the extrusion, and the plane I need is one of the parents). When an extrusion is found, it passes this into the same function to look for the parent plane (the one I need). If found, I return this value to the main sub.


When I try to print out the name or type of feature the result is, it says Object required. Within the function I checked right before I used "set" to see what the type and name is. I get 4 and Top, which is what I expected. I know I'm overlooking something simple.


If anyone has a better way about finding the parent plane of the extrusion, it would be greatly appreciated.