Points cloud with iLogic

glenn.bowie.2020
Explorer

Points cloud with iLogic

glenn.bowie.2020
Explorer
Explorer

As part of a design I need to take a list of parameters linked to an excel sheet and manually insert and dimension ~= 50 points or 150 parameters, I feel like I'm close to getting the automation but I keep getting an error that my parameter is incorrect on line 13 when I go to create the point, the parameters are in groups of 3, with the format pointNamex,...y,...z.

 

Any help is appreciated

 

Dim oPartDoc As PartDocument = ThisApplication.ActiveDocument
Dim oParams As Parameters = oPartDoc.ComponentDefinition.Parameters
Dim oCompDef As PartComponentDefinition = oPartDoc.ComponentDefinition
Dim oTG As TransientGeometry = ThisApplication.TransientGeometry

For i As Integer = 1 To oParams.Count Step 3
    
    Dim param1 As Parameter = oParams.Item(i)
    Dim param2 As Parameter = If(i + 1 <= oParams.Count, oParams.Item(i + 1), Nothing)
    Dim param3 As Parameter = If(i + 2 <= oParams.Count, oParams.Item(i + 2), Nothing)
	
    Dim oPoint As Point = oTG.CreatePoint(param1.Value,param2.Value,param3.Value)
    Dim oWorkPoint As WorkPoint = oCompDef.WorkPoints.AddByPoint(oPoint)
    oWorkPoint.Name = Left(param1.name, (Len(param1.Name) -1))
	
Next 

 

0 Likes
Reply
73 Views
0 Replies
Replies (0)