1 Reply Latest reply on May 26, 2014 1:53 AM by Stefan Wozniak

    i want a point in 3d sketch

    Vishaldeep Singh

      hello

      in the attachment there is excel file and macro file.

      there is a special symbol "$" in the  excel sheet and i want a point after $ sign.

      in my code i am getting every point

       

      so my question is is this thing possible in macro coding.

        • Re: i want a point in 3d sketch
          Stefan Wozniak

          Hi Vishaldeep,

          You just need to add IF condition.

          If there is $ then get values from next line and insert point. In other cases do nothing, just increment i variable.

           

              Do While exSheet.Cells(i, 1).Value <> ""

                 

                  If exSheet.Cells(i, 1).Value = "$" And exSheet.Cells(i + 1, 1).Value <> "" Then

                     

                      xpt = exSheet.Cells(i + 1, 1).Value

                      ypt = exSheet.Cells(i + 1, 2).Value

                      zpt = exSheet.Cells(i + 1, 3).Value

                     

                      xpt = xpt * 0.001

                      ypt = ypt * 0.001

                      zpt = zpt * 0.001

                     

                     

                      Set skPoint = swModel.CreatePoint2(xpt, ypt, zpt)

                      Exit Do

                  End If

                 

                  i = i + 1

           

           

              Loop

           

          Regards,

          Stefan