kwiecień 2023

nd pn wt śr czw pt sob
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30            

« Autodesk Simulation CFD 2012 | Main | Autodesk Product Design Suite - rozwój koncepcji w Alias Design »

22 listopad 2011

Comments

Feed You can follow this conversation by subscribing to the comment feed for this post.

Vibowit

Witam. Czy jest możliwe przy pomocy funkcji ilogic wyliczenie rozmiaru part'u dowolnego koształtu po dx x dy x dz. Pozdrawiam.

Przemyslaw Sokolowski

Jak najbardziej:

doc = ThisDoc.Document

Mmax=doc.ComponentDefinition.RangeBox.MaxPoint.X
Ymax=doc.ComponentDefinition.RangeBox.MaxPoint.Y
Zmax=doc.ComponentDefinition.RangeBox.MaxPoint.Z

Xmin=doc.ComponentDefinition.RangeBox.MinPoint.X
Ymin=doc.ComponentDefinition.RangeBox.MinPoint.Y
Zmin=doc.ComponentDefinition.RangeBox.MinPoint.Z

DeltaX=(Xmax-Xmin)*10
DeltaY=(Ymax-Ymin)*10
DeltaZ=(Zmax-Zmin)*10

Delta=DeltaX & " x " & DeltaY & " x " & DeltaZ & " mm"

MessageBox.Show(Delta, "Title")

Vibowit

Witam, Wspomina Pan w swojej prezentacj że można tą regule (automatycznej aktualizacji kazdego partu w assambly) podczepic automatycznie do każdego partu z osobna jak to zrobic. Ponieważ jak sie zmienia cos w skletonie to part'y zmieniaja swoją wielkośc parametr nie chce automatycznie. musze wejsc w kazda czesc i zaktualizowac.

Vibowit

doc = ThisDoc.Document

Xmax=doc.ComponentDefinition.RangeBox.MaxPoint.X
Ymax=doc.ComponentDefinition.RangeBox.MaxPoint.Y
Zmax=doc.ComponentDefinition.RangeBox.MaxPoint.Z
Xmin=doc.ComponentDefinition.RangeBox.MinPoint.X
Ymin=doc.ComponentDefinition.RangeBox.MinPoint.Y
Zmin=doc.ComponentDefinition.RangeBox.MinPoint.Z

DeltaX= FormatNumber((Xmax-Xmin)*10, 0)
DeltaY= FormatNumber((Ymax-Ymin)*10, 0)
DeltaZ= FormatNumber((Zmax-Zmin)*10, 0)

Delta=DeltaX & " x " & DeltaY & " x " & DeltaZ & " mm"

MessageBox.Show(Delta)

iProperties.Value("Custom", "Delta")= Delta

iProperties.Value("Project", "Description")= Delta

Jak zrobic zeby kazdy part aktualizowal sie automatycznie w assambly po zmianie np. skeletona. Bo musze wchodzi w kazdy pokolej incze zostaje stary parametr.
Pozdrawiam

dydko

1. Do szablonu blach dodaj regułę, w Ilogic jest możliwość uruchamiania reguł gdy część zmienia geometrię(Zarządzanie -> iLogic -> Procedury wyzwalania zdarzeń). Dodatkowo w numer części mam =xx

2. Możesz użyć SheetMetalExtentsInstall.zip

3. Ja miałem dokończyć kod w VBA idea na dole
Sub CzyRozwiniete()
Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument
Dim oCompDef As SheetMetalComponentDefinition
Set oCompDef = oDoc.ComponentDefinition

Dim oParameters As Parameters
Set oParameters = ThisApplication.ActiveDocument.ComponentDefinition.Parameters

Dim oLengthParam As Parameter
Dim oLengthParam1 As Parameter

On Error Resume Next
Set oLengthParam = oParameters.Item("Dlugosc")
Set oLengthParam1 = oParameters.Item("Szerokosc")
If Err Then
' Unable to get the Parameters object, so exit.
MsgBox "Podczas działania skryptu w pliku '" & oDoc.DisplayName & _
"' wykryto błąd ", vbCritical, "Dydko"
Exit Sub
End If
On Error GoTo 0
'Change the equation of the parameter.
'oLengthParam.Expression = "3.5 in"
' units !!!
' MsgBox oCompDef.FlatPattern.Width
'Dim invUOM As UnitsOfMeasure
'Set invUOM = PartDocument.UnitsOfMeasure

'Dim strWidth As String = invUOM.GetStringFromValue(oCompDef.FlatPattern.Width, UnitsTypeEnum.kDefaultDisplayLengthUnits)
'oLengthParam.Expression = oCompDef.FlatPattern.Width * 10
'oLengthParam1.Expression = oCompDef.FlatPattern.Length * 10

'MsgBox "OK222222"

If oCompDef.HasFlatPattern = False Then

'MsgBox ("rozwijam")
Else

'MsgBox ("bylo")
End If

' If oCompDef.HasFlatPattern = False Then
' oCompDef.Unfold 'rozwija
' MsgBox ("rozwijam")
' Else
' oCompDef.FlatPattern.Edit
' MsgBox ("bylo")
' End If
End Sub

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Your Information

(Name is required. Email address will not be displayed with the comment.)