omar91
Guest
Hello everyone, my name is omar and I am new to the forum. I am a mechanical engineering student (graduate) and I just started using solidworks.
not having found a command to import a set of points, I searched on the internet a macro that allowed me to do so. I found one that seemed to work and that I bring back:
sub main()
set swapp = application.sldworks
set part = swapp.activedoc
swapp.activedoc.activeview.framestate = 1
dim skpoint as object
open "c:\users\omar\desktop\material thesis\voluta\linee\prova.txt" for input as #1
part.sketchmanager.insert3dsketch true
do while not eof(1)
input #1, x, y, z
set skpoint = part.sketchmanager.createpoint(x, y, z)
loop
♪
end
I say it seemed because the values of the points are distorted, e.g. 45,888 becomes 45888, 451,888444 becomes 451888.444, i.e. all numbers are increased of a factor 1000; moreover for values of the terna "small" (say below the tenth, although in reality it seems quite random), the numbers are read directly as 0 (for "resolvere" I thought to give in input reduced values of a factor 1000 x
for my abilities all this appears as "mysterious", can someone give me explanations? Thank you.
not having found a command to import a set of points, I searched on the internet a macro that allowed me to do so. I found one that seemed to work and that I bring back:
sub main()
set swapp = application.sldworks
set part = swapp.activedoc
swapp.activedoc.activeview.framestate = 1
dim skpoint as object
open "c:\users\omar\desktop\material thesis\voluta\linee\prova.txt" for input as #1
part.sketchmanager.insert3dsketch true
do while not eof(1)
input #1, x, y, z
set skpoint = part.sketchmanager.createpoint(x, y, z)
loop
♪
end
I say it seemed because the values of the points are distorted, e.g. 45,888 becomes 45888, 451,888444 becomes 451888.444, i.e. all numbers are increased of a factor 1000; moreover for values of the terna "small" (say below the tenth, although in reality it seems quite random), the numbers are read directly as 0 (for "resolvere" I thought to give in input reduced values of a factor 1000 x
for my abilities all this appears as "mysterious", can someone give me explanations? Thank you.