Inventor Engineer-To-Order (Read-Only)
Welcome to Autodesk’s Inventor ETO Forums. Share your knowledge, ask questions, and explore popular Inventor ETO topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

System Function "removeIf?()" doesnt exist?

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
JamesNordgren
728 Views, 3 Replies

System Function "removeIf?()" doesnt exist?

Hello, I am trying to set a the part1 reference for a Linear dimension to be only the odd-indexed children of another part.  I follow the examples given in help, and the code compiles but gives the error "No such method 'removeIf?'"

 

Child ToLeftGussets As :IvLinearDimension, Quantity = 3
			part1 =  nth(removeIf?(even?(Child.index, Model.FrameGusset)))
			entity1 = "Edge:5" 
			part2 = Model.FrameChannel
			entity2 = "Vertex:1"
			textOrigin = funcpointLnrDimOffset((If bTop? Then :Up Else :Down), 1)
			formattedText = "<DimensionValue/>"
			dimType = :horizontal 
			centerText? = True
			arrowheadsInside? = False
		End Child

 Can anyone help or see why this doent work?  I am running

 

3 REPLIES 3
Message 2 of 4
Lesoux
in reply to: JamesNordgren

I would make something like that.

 

Child ToLeftGussets As (If odd?(Child.index) Then :IvLinearDimension Else :NullDesign), Quantity = 3
			part1 =  nth(Child.index, Model.FrameGusset)
			entity1 = "Edge:5" 
			part2 = Model.FrameChannel
			entity2 = "Vertex:1"
			textOrigin = funcpointLnrDimOffset((If bTop? Then :Up Else :Down), 1)
			formattedText = "<DimensionValue/>"
			dimType = :horizontal 
			centerText? = True
			arrowheadsInside? = False
		End Child
Win10 x64
Xeon E5-1630
32 Gb RAM
Quadro K5200

Inventor 2020.3.4, Build 373
Message 3 of 4
JackGregory
in reply to: JamesNordgren

It is an odd error message, and I consider that a defect, but I think it doesn't recognize the call to removeIf? with one argument. And, actually, even? with two arguments should probably error as well.  I will investigate the error handling here.

removeIf?(even?(Child.index, Model.FrameGusset))
Message 4 of 4
JackGregory
in reply to: JackGregory

I looked into this, and we have a documentation bug that I think is causing the confusion.  The answer is, there is actually no function removeIf?, just like it says.  There is documentation for such a function, but you might notice in the examples shown in the documentation, the function actually being called is removeIf, without the question mark.  This makes sense, since we only use the ? on a function name if it returns a boolean, and this function returns a list.

 

Also, the first argument must be the Name of a function.  So you need :even?

 

So I will get the documentation corrected.  Thanks for finding this.

 

As a side comment, hard-coding the quantity, and then applying a function that returns a list is a bug waiting to happen.  The quantity should be based on the list length.  Pulling these out into a rule would make it a lot clearer.  Then quantity could be the length of the list produced from the removeIf function, and the nth(child.index, <list>) would be pulling from a list that is guaranteed to be of the same size as the quantity.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report