Community
인벤터 Inventor - 한국어
프로그램에 관한 사용 방법, 기술, 정보 등을 검색하고, 질문을 통해 서로 도움을 주고 받을 수 있습니다.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

스윕길이 산출방법 문의 합니다.

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
cjfgns1003
281 Views, 8 Replies

스윕길이 산출방법 문의 합니다.

스윕으로 작성한 PIPE입니다.

스윕에사용된 스케치길이를 사용하여 BOM에 길이를 나타내고 싶은데 방법이 무엇일까요?

 

cjfgns1003_0-1700119287161.png

 

8 REPLIES 8
Message 2 of 9
손광호
in reply to: cjfgns1003

경로 스케치의 직선 길이값  및 호의 길이를 치수로 뽑으면 매개변수 값에 해당 값이 들어오고 그 해당 매개변수를 내보내기 체크하면 사용자 iproperties로 자동입럭되니다. 사용자 속성의 조합된 수식을 사용하시면 파이핑 길이로해서 직선구간과 호의길이를 합칠수 있습니다. 사용자 특성으로 들어오면 bom의 구분항목으로 설정해서 리스트를 반영할수 있습니다.

줌인테크 Techanical Support Engineer
Message 3 of 9
cjfgns1003
in reply to: 손광호

관련하여 테스트중인 iLogic 입니다.

결과값에 소수점자리가 안되네요..

 

Sub main
    Dim oDoc As PartDocument = ThisApplication.ActiveDocument
    Dim oDef As PartComponentDefinition = oDoc.ComponentDefinition
	Dim LengthTotal As Double = 0
	Dim oPath As Path
	For Each oSweep As SweepFeature In oDef.Features.SweepFeatures
		oPath = oSweep.Definition.Path
		LengthTotal = LengthTotal + GetLengthOfSweep(oPath)
	Next

    Dim oUParams As UserParameters = oDoc.ComponentDefinition.Parameters.UserParameters
    Dim oExists As Boolean = False
	Dim oParamName As String = "SIZE"
    For Each oUParam As UserParameter In oUParams
    	If oUParam.Name = oParamName Then
			oUParam.Value = LengthTotal
			oExists = True
		End If
    Next

    If oExists = False Then
        oUParams.AddByValue(oParamName, LengthTotal, UnitsTypeEnum.kDefaultDisplayLengthUnits)
    End If
	ParaExport(oDef.Parameters.UserParameters, oParamName, kZeroDecimalPlacePrecision)
    oDoc.Update
End Sub

Private Function GetLengthOfSweep(ByVal oPath As Path) As Double
    Dim TotalLength As Double = 0
    Dim oCurve As Object
	Dim oCurveEval As CurveEvaluator
	Dim MinParam As Double
    Dim MaxParam As Double
    Dim length As Double
    For i As Integer = 1 To oPath.Count
        oCurve = oPath.Item(i).Curve 
        oCurveEval = oCurve.Evaluator
        oCurveEval.GetParamExtents(MinParam, MaxParam)
        oCurveEval.GetLengthAtParam(MinParam, MaxParam, length)
        TotalLength = TotalLength + length
    Next
	Return TotalLength
End Function

Private Sub ParaExport(ByRef oUParas As UserParameters, ByVal oParaName As String, _
						ByVal oDecimalPrecision As CustomPropertyPrecisionEnum)
    For Each oUPara As UserParameter In oUParas
		If oUPara.Name = oParaName Then
            oUPara.ExposedAsProperty = True
			Dim oCPF As CustomPropertyFormat = oUPara.CustomPropertyFormat
			oCPF.PropertyType = CustomPropertyTypeEnum.kNumberPropertyType
            oCPF.Precision = oDecimalPrecision
			oUPara.Comment = "스윕길이로 산출함."
            Exit Sub
        End If
    Next
End Sub

 

Message 4 of 9
손광호
in reply to: cjfgns1003

오토데스크에 공식문서에도 좀 언급되는데 하단에 참고할만한 로직 소스도 같이 있네요. 로직으로 하고 계신부분은 대단하신듯. 혹 도움을 드릴수 있음 보고 다시 답변드릴께요. 하기링크와 젤 하단의 참조링크 참좃내주세요.

https://www.autodesk.co.kr/support/technical/article/caas/sfdcarticles/sfdcarticles/KOR/Inventor-How...

줌인테크 Techanical Support Engineer
Message 5 of 9
yd_kwon
in reply to: cjfgns1003

Cap 2023-11-17 10-19-57-557.png

올려주신 iLogic으로 실행하면, 유저 파라미터로 잘 들어갑니다.

혹시 몰라서 인벤터 파일도 첨부 파일로 올려놓습니다.

CAM-Fusion 360/Inventor
CAD-Fusion 360/Inventor
Before PowerMILL
Message 6 of 9
cjfgns1003
in reply to: yd_kwon

iProperties값에서 소수점자리표현하고싶은데 어디를 수정해야될까요?

 

cjfgns1003_0-1700184700295.png

 

Message 7 of 9
yd_kwon
in reply to: cjfgns1003

Cap 2023-11-17 10-53-14-602.pngCap 2023-11-17 10-53-26-485.png

iProperty 값이 아닌 파라미터 쪽에서 수정해야 할 것 같습니다.

파라미터 → 사용자 특성 형식 → 정밀도 수정 하면 iProeprty 값도 반영됩니다.

 

Cap 2023-11-17 10-55-06-488.png

CAM-Fusion 360/Inventor
CAD-Fusion 360/Inventor
Before PowerMILL
Message 8 of 9
yd_kwon
in reply to: cjfgns1003

iLogic 중간에 단위 정밀도가 항상 0로 되어 있습니다.

 

kZeroDecimalPlacePrecision → 정수 형태, 소수점 아래 없음

kThreeDecimalPlacesPrecision  → 소수점 3자리 까지 사용

 

ParaExport 함수 호출시 아래처럼 바꾸면 3자리 적용됩니다.

 

ParaExport(oDef.Parameters.UserParameters, oParamName, kThreeDecimalPlacesPrecision)

 

 

아래 API 도움말 참고하세요.

https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=CustomPropertyPrecisionEnum

CAM-Fusion 360/Inventor
CAD-Fusion 360/Inventor
Before PowerMILL
Message 9 of 9
cjfgns1003
in reply to: yd_kwon

자리수 설정을 잘못했었네요. 답변 감사합니다.~~~

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums