Reply

Example DFT files that contain parametric relationships wanted


I am trying to create parametric folding cartons with SolidEdge. I am having very
limited success taking files from another CAD program, and constraining them. I
might need to rethink, and rebuild the cartons completely in SolidEdge.
I have been through the demos, but still do not have a clear picture of how it all
works.
I am hoping to obtain some example DFT files that contain formula data - ie.
If A is between 1 and 2, then B is = 0.500, C = 0.125
If A is between 2 and 3, then B is = 1.000, C = 0.250
If anyone would be willing to email me some example files that they have, I would
appreciate them - If that is OK with Ricky.
2 REPLIES

Re: Example DFT files that contain parametric relationships wanted

Ralph,
How much do you know about VB?
You can write a VB macro and assign the output of the macro in a .bas file
as the input to a dimension.
You then assign another variable such as another dimension as the input to
the macro.
Here is example code for the macro.
Attribute VB_Name = "Module1"
Function SolidEdgeIf(dblValue As Double) As Double
If dblValue <=130 Then
SolidEdgeIf = 30
Else
SolidEdgeIf = 50
End If
End Function

I have attached a sample draft file (function.dft) and a sample .bas file
(If._bas).
Save the If._bas file to the C:\temp folder. The path to the macro file
cannot have any spaces in the name.
Remane the file to If.bas.
Open the Draft file.
You will see two dimensions (200mm and 50mm).
Change the 200mm dimension to 100mm. The 50mm dim will change to 30mm.
Regards,
Rick B.



Re: Example DFT files that contain parametric relationships wanted


Thanks for the help Ricky. That is pretty neat to be able to do that. I took a look
at variables table to see how it works. I have some limited VBA experience with
AutoCAD 2000, so I don't know how much of that will apply to SolidEdge.
Ralph
"Ricky Black" wrote:
>Ralph,
>How much do you know about VB?
>
>You can write a VB macro and assign the output of the macro in a .bas file
>
>as the input to a dimension.
>You then assign another variable such as another dimension as the input to
>
>the macro.
>
>Here is example code for the macro.
>
>Attribute VB_Name = "Module1"
>Function SolidEdgeIf(dblValue As Double) As Double
>
>If dblValue <=130 Then
> SolidEdgeIf = 30
>Else
> SolidEdgeIf = 50
>End If
>
>End Function
>
>
>I have attached a sample draft file (function.dft) and a sample .bas file
>
>(If._bas).
>Save the If._bas file to the C:\temp folder. The path to the macro file
>cannot have any spaces in the name.
>Remane the file to If.bas.
>
>Open the Draft file.
>You will see two dimensions (200mm and 50mm).
>Change the 200mm dimension to 100mm. The 50mm dim will change to 30mm.
>
>Regards,
>Rick B.
>
>
>
>