Showing results for 
Search instead for 
Do you mean 

recursive cube generator with scale builder

[ Edited ]

I'm trying to create a recursive cube generator using the scalebuilder class. It almost works the way I intended except I'm having an issue with the scalebuilder.uniformfactor attribute. Everytime I run the loop, it exponentiates. How could I make it immutable? See attached picture


    def recursivecubes(self, bodiez, endlist):
        global bodylist, scaleendpoint, scalebuilder, scalefactor
        scaleendpoint = []
        bodylist = []

        #find object
        for body in bodiez:
            #append to list so that way we are not scaling every cube body just the first cube
            self.theLw.WriteLine("    Journal Identifier: " + str(body.JournalIdentifier))


        #iterating over the list of endpoints
        for i in range(len(endlist)):

            #call the scalebuilder method
            scaleBuilder = workPart.Features.CreateScaleBuilder(NXOpen.Features.Feature.Null)

            #scale the first cube, we don't want to scale each newly created cube
            #list of end points

            #where to place each scaled cube
            scaleBuilder.Point = scaleendpoint[i]

            #refer to expression attributes
            #herein lies the issue, this attribute exponentiates for every iteration
scaleBuilder.UniformFactor.Value=scalefactor #create the cube scaleBuilder.Commit()

#these properties should lock the variable but they don't work
#scaleBuilder.UniformFactor.IsNoEdit= True
#scaleBuilder.UniformFactor.IsNoUpdate= True

#resetting the uniformfactor does not work

#always need to call this scaleBuilder.Destroy()



Re: recursive cube generator with scale builder

[ Edited ]

almost works the way I intended