Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
 - Need support? Ask a question to our Community Support category.
 - Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
 - Be respectful, on topic and if you see a problem, Flag it.
 
If you would like to contact our Community Manager personally, feel free to  send a private message or an email.
Do editing logic functions work with enums?
Lee_Hesketh                
                
                    Member, Developers Posts: 148 ✭✭✭                
            
                    Do editing logic functions work with enums? If so, how do I implement it?
Thanks
Lee Hesketh
                Thanks
Lee Hesketh
There are 10 types of people in the world. Those who know binary, those who don't and those who didn't expect base 3!
0    
            Best Answers
- 
            
NeilCooke
                        
                        
                            Moderator, Onshape Employees Posts: 5,912 
                        
                    Could it be as simple as the misspelling of "length"?Senior Director, Technical Services, EMEA6 - 
            
NeilCooke
                        
                        
                            Moderator, Onshape Employees Posts: 5,912 
                        
                    Try something like:if(changedDefinition.myEnum == myEnum.ONE)<br>changedDefinition.length = 1*inch; <br>if(changedDefinition.myEnum == myEnum.TWO)<br>changedDefinition.length = 2*inch; <br>}<br>return changedDefinition;</code><h2><pre class="CodeBlock"><code>if(oldDefinition.myEnum != changedDefinition.myEnum)<br><code> {<br>
Senior Director, Technical Services, EMEA2 
Answers
export function defaults(context is Context,id is Id, oldDefinition is map, changedDefinition is map) returns map { if(oldDefinition.myEnum==myEnum.ONE) { changedDefinition.legnth = 1*inch; } return changedDefinition; }But nothing happens and don't know why.