Showing posts with label solidworks workaround. Show all posts
Showing posts with label solidworks workaround. Show all posts

Wednesday, August 31, 2011

Solidworks Custom Property Builder Work Around

I have been asked several times if there is a quick way of populating custom properties into drawings, parts, and assemblies outside of using a data management system.  Solidworks has created a custom property builder to speed up the process.  You can create a drop down list for any custom property so that it can be easily selected. 


Property tab builder 


The problem is that when you save the property template out it only allows you to save this for a part file


Capture 
 To save these templates for drawings and assemblies first you must save it as a part template (.prtprp), then you can rename the extension to .asmprp for assemblies .drwprp for drawings. For step by step instructions on how to use and create the template please refer to the solidworks help menu.


 


Ketul Patel



Monday, August 1, 2011

SolidWorks IIF equal’s to “the syntax is wrong” error workaround



  


Ever try creating an if-then statement in SolidWorks to control a feature. Well if you ever want to then you need to use the IIF function. Yes there are two I’s.


 


Background:


The syntax of the Visual Basic IIf function is:  iif(expression, truepart, falsepart)


 


where:


·expression is the expression you want to evaluate


·truepart is the value to use if expression is true


·falsepart is the value to use if expression is false


 


ex:


· The following equation suppresses a linear pattern when the value of global variable "overall length" is less than 40.


"LPattern1" = iif ("overall length"<40, "suppressed", "unsuppressed")


 


· This following equation unsuppresses a rib feature when a particular dimension is greater than 100.


"Rib1" = iif ("D3@Sketch1">100, "unsuppressed", "suppressed")


 


Issue:


What SolidWorks doesn’t like and will prevent from working is the equals sign used for an equal’s to syntax. Such as


 


“D1@sketch3” = iif (“D2@sketch1” = 0.5, 1.0, 1.25)


 


Work Around:


The workaround for this is to utilize the “double negative” syntax. Such as


 


“D1@sketch3” = iif (not(“D2@sketch1” <> 0.5), 1.0, 1.25)


 


Which is equivalent to “D1@sketch3” = iif (“D2@sketch1” = 0.5, 1.0, 1.25)