Linking many Dimensions to a single parameter
Linking many Dimensions to a single parameter
(OP)
I have a lot of dimensions in a single sketch, approx 120 dimensions. I have around 60 radial dimension in it. I want to link all the radius values to a single parameter. Instead of selecting the dimension individually and linking it to the parameters, is there any other option in catia where I can choose multiple dimension and link it to the parameter. I do not want to use equivalent dimension option. The problem gets even tougher with many similar sketches in the same catpart. Please suggest your ideas.





RE: Linking many Dimensions to a single parameter
you can select all the radiis in the tree and right click ..go to select objects....equivalent dimensions...in the equivalent dimensions dialog box...right click in the value field...choose edit formula....now you can relate this to a single parameter.
<hope it helps >
RE: Linking many Dimensions to a single parameter
RE: Linking many Dimensions to a single parameter
In many cases, it is better to keep sketch simple (no fillets), and use 3D featues later in the tree to add the fillets. Another example is duplicated shapes; do not mirror or draw the same shape within the sketch. Instead, use Symmetryr or Pattern to duplicate the shape.
RE: Linking many Dimensions to a single parameter
1) Find all the "Length Constraints"
2) Loop through the results : looking for "Radius"
3) If radius is found, create the relation
Record your self doing one of them and look at the code.
This will show you how to assign the constraint to the parameter.
One way to see the code that selects all the "Length Constraint" is to record yourself doing a search for them using the Search tool.
Then add code that loops through the search results looking for the word "Radius" and creates the relation.
(assuming the constraints have the names something like "Radius.26")
RE: Linking many Dimensions to a single parameter
Regards
Fernando
https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...
RE: Linking many Dimensions to a single parameter
RE: Linking many Dimensions to a single parameter
CODE -->
Sub Link_Radius() Set Document = CATIA.ActiveDocument Dim oPart As Part Set oPart = Document.Part Dim oBody As Body Set oBody = oPart.Bodies.Item("PartBody") Dim oSketch As Sketch Set oSketch = oBody.Sketches.Item("Sketch.1") Dim oConstraints As Constraints Set oConstraints = oSketch.Constraints icount = 0 For i = 1 To oConstraints.Count Set Cst = oConstraints.Item(i) If Cst.Type = catCstTypeRadius Then Dim sName As String sName = Cst.Name Dim Dime As Object Set Dime = Cst.Dimension Dim sParam As String sParam = Dime.Name Dim lValue As Double lValue = Dime.Value / 25.4 icount = icount + 1 Link_Parameter_to_Dimension sName, sParam, lValue, icount Else End If Next i End Sub Function Link_Parameter_to_Dimension(sName As String, sParam As String, lValue As Double, ByVal icount As Integer) Dim oPart As Part Set oPart = CATIA.ActiveDocument.Part Dim D1Name As Object Set D1Name = oPart.FindObjectByName(sName) Dim D1 As RealParam If icount = 1 Then Set D1 = oPart.Parameters.CreateReal("Radius", lValue) Else End If Dim oRelations As Relations Set oRelations = oPart.Relations Dim Param As Parameters Set Param = oPart.Parameters.SubList(D1Name, True) Dim sBodyFormula As String sBodyFormula = "(" & "Radius" & "*1in)" Dim oFormula As Formula Set oFormula = oRelations.CreateFormula("", "", Param.Item(1), sBodyFormula) End FunctionLink all sketch radius to single parameter.. just be careful with the value of the radius.