아래 예제 참조해 보세요~
Dim oTransientGeometry As TransientGeometry = ThisApplication.TransientGeometry Dim oVector As Vector = oTransientGeometry.CreateVector(1, 2, 3) Dim oMatrix As Matrix = oTransientGeometry.CreateMatrix oMatrix.SetTranslation(oVector) Dim oAssemblyDocument As AssemblyDocument = ThisDoc.Document oAssemblyDocument.ComponentDefinition.Occurrences.Add("C:\Users\kimdo\Documents\Vault\ADSK\Temp\부품1.ipt", oMatrix)
X = 10, Y = 20, Z = 30 좌표에 배치한 결과 입니다.
멋지십니다...제가 찾던 코드입니다.
유사한 걸 찾긴 했으나
CreateVector(1, 2, 3)
벡터 값 조정에 실패해서 배치에 실패했는데 감사합니다.
혹 부품 배치가 가져오는 부품의 원점인데 특정 끝 부분이라고 하면 해당 부품의 원점을 스케치에서 이동해야 할까요?
인벤터 사용자 좌표계를 추가해서 이동하는 기준점으로 하는 구문은 어려울까요?
그러면 원하는 이동을 자유롭게 구현할 수 있을 듯 합니다.
혹 가능하시면 다시 한번 부탁 드립니다.