• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

import files to solidwork

  • Thread starter Thread starter Jonny123
  • Start date Start date
thank you really for the patience and exhausting answer, now I try to cuff in matlab to look for if you can change the coding. :wink:
 
I modified the matlab file by adding the missing character (a simple "\r" for those who should in the future have the same problem and happen here to read) and now it works perfectly.
Thank you very much for your help.
 
Hi, I'm going to disturb you for a problem I hope to be easy to solve.
I wanted to make the creation of my wind blade completely automatic so I wanted to insert at the end of the code a part that automatically executed the loft through the created curves.
having no knowledge in visual-basic I tried the road recommended by wave i.e. trying to record the macro and this is the result:
Code:
dim swapp as object

dim part as object
dim boolstatus as boolean
dim longstatus as long, longwarnings as long

sub main()

set swapp = application.sldworks

set part = swapp.activedoc
boolstatus = part.extension.selectbyid2("curva1", "referencecurves", -0.02323359137137, 0.03775347155462, -0.0991954136307, true, 0, nothing, 0)
boolstatus = part.extension.selectbyid2("curva2", "referencecurves", -0.03043460642334, 0.03647471592106, 0.1153862564531, true, 0, nothing, 0)
boolstatus = part.extension.selectbyid2("curva3", "referencecurves", -0.03975940136365, 0.02775955938299, 0.328980067293, true, 0, nothing, 0)
boolstatus = part.extension.selectbyid2("curva4", "referencecurves", -0.03790190566718, 0.02741851668293, 0.5426116588759, true, 0, nothing, 0)
boolstatus = part.extension.selectbyid2("curva5", "referencecurves", -0.03634063539187, 0.02937658495665, 0.7590427872709, true, 0, nothing, 0)
boolstatus = part.extension.selectbyid2("curva6", "referencecurves", -0.03145504216354, 0.04102568127064, 0.8217471614732, true, 0, nothing, 0)
boolstatus = part.extension.selectbyid2("curva7", "referencecurves", 0.01818298740508, 0.0587712077068, 0.8801247619941, true, 0, nothing, 0)
boolstatus = part.extension.selectbyid2("curva8", "referencecurves", 0.008409694106348, 0.09480712101444, 0.9310866166167, true, 0, nothing, 0)
boolstatus = part.extension.selectbyid2("curva9", "referencecurves", 0.00517330947045, 0.1456794356446, 0.9730442037058, true, 0, nothing, 0)
boolstatus = part.extension.selectbyid2("curva10", "referencecurves", -0.004999411595776, 0.1624820827024, 0.9838479288466, true, 0, nothing, 0)
boolstatus = part.extension.selectbyid2("curva11", "referencecurves", -0.002520055017214, 0.1819917853722, 0.9968353253767, true, 0, nothing, 0)
boolstatus = part.extension.selectbyid2("curva12", "referencecurves", -0.007886847900238, 0.1979063394773, 1.007474443403, true, 0, nothing, 0)
boolstatus = part.extension.selectbyid2("curva13", "referencecurves", -0.01295489593969, 0.2159733107233, 1.019614528264, true, 0, nothing, 0)
part.clearselection2 true
boolstatus = part.extension.selectbyid2("curva1", "referencecurves", 0, 0, 0, false, 1, nothing, 0)
boolstatus = part.extension.selectbyid2("curva2", "referencecurves", 0, 0, 0.2145, true, 1, nothing, 0)
boolstatus = part.extension.selectbyid2("curva3", "referencecurves", 0, 0, 0.429, true, 1, nothing, 0)
boolstatus = part.extension.selectbyid2("curva4", "referencecurves", 0, 0, 0.6435, true, 1, nothing, 0)
boolstatus = part.extension.selectbyid2("curva5", "referencecurves", 0.005148, 0, 0.858, true, 1, nothing, 0)
boolstatus = part.extension.selectbyid2("curva6", "referencecurves", 0.006435, 0.00800194, 0.921682, true, 1, nothing, 0)
boolstatus = part.extension.selectbyid2("curva7", "referencecurves", 0.007722, 0.0315102, 0.981404, true, 1, nothing, 0)
boolstatus = part.extension.selectbyid2("curva8", "referencecurves", 0.009009, 0.0690633, 1.03345, true, 1, nothing, 0)
boolstatus = part.extension.selectbyid2("curva9", "referencecurves", 0.010296, 0.118326, 1.07459, true, 1, nothing, 0)
boolstatus = part.extension.selectbyid2("curva10", "referencecurves", 0.012012, 0.136376, 1.08618, true, 1, nothing, 0)
boolstatus = part.extension.selectbyid2("curva11", "referencecurves", 0.01287, 0.154425, 1.09777, true, 1, nothing, 0)
boolstatus = part.extension.selectbyid2("curva12", "referencecurves", 0.014586, 0.172475, 1.10936, true, 1, nothing, 0)
boolstatus = part.extension.selectbyid2("curva13", "referencecurves", 0.015444, 0.190524, 1.12095, true, 1, nothing, 0)
part.insertloftrefsurface2 false, true, false, 1, 6, 6
end sub
I was very sorry about the numerical variability in the function topics and I can't get a general function with which to perform for example a cycle for. I have searched through google possible pre-made solutions, but the results in a plentiful half hour have not yet arrived. if someone has any idea what the code is to perform a loft between n curves with growing name (curva1,curva2,...,curvan) and could suggest it would simplify me noteworthy the work of implementation of the models (ahimè are only at first missing months of aerodynamic processing)
 
Hello, everyone.
I also need to import some points to create curves.
In practice I have to create a movement simulation on solidworks of a very simple vehicle.
My rapporteur has created a program to describe the movement of the medium on matlab in 3d, and the solution I have identified is to bind the assembly cinematically, and then create as many curves as are necessary for the constraints, and in the animation to force each point/wink to move following a certain curve.
I felt like the simplest solution, if you have other ideas tell me!
The problem is that the prof gives me the coordinates of these 8 points (how many are enough), together with the information of time, in a matrix of matlab.
I will therefore have to be the one to create a macro that amounts the points as they want to put solidworks...the problem is that I have no idea how to create a macro like that! what language is used?
especially, in what format do I have to ask the data/matrix out of matlab to my prof?
thanks in advance to all for possible help!
Unfortunately in previous posts I saw that you were using .pts or .txt files...
for matlab how you can export a matrix, and what is the best format to configure it with solidworks?
according to you then in the animation how can I correlate the information of time to the path of the various points outlined (i.e., how can you say "all the constraints, in time 1, go to point 1"? )?
Thank you so much!
 
If it's eight stitches, just give you a print and insert them by hand, without having to make a macro!!
otherwise make a text sheet where the points are placed in the following scheme:

x1,y1,z1
x2,y2
....
....
....

and then open it with the curved function through x,y,z and sw points directly creates the curve.
for your next question about cinematism, I couldn't give you an answer. I should see the cinema.
But I think if you do a groove in one part using as a profile guide your curve you are fine.
then, in the simulation, it seems to me that you can insert a time/position table to manage the movement.
 
Hello, then for the cinematism I will try that!
I must be explained badly...the reference points are 8 on the model, but I have as many curves/trajectories to trace, and the coordinates are enclosed in a single matrice matlab (24 columns per x,y,z of every trajectory of each point, plus one for the time).
is there a possibility to export from matlab to excel directly in a simple way a matrix?
or in what format should I export from matlab?
Thank you!
 
As long as I don't use matlab from a lot, you have the opportunity to export a matrix in text sheet and then read it with excel.
or process it with a text editor and make as many files as you need to read.
you don't want to use a macro unless you have to repeat this job so many times.
you must then create 8 files, one for each trajectory and read it from solidworks with the command I marked you before.
make 8 curves and from those, projecting them on a sketch, create geometry for your part.
 
Okay, thanks for the tip on excel, with xlswrite command I managed to get
the data and put them in matrix on excel, and then from there I formatted them correctly to put them on a .txt file that I imported on solidworks.
pra I have to create the ground on which it will move, I have the curve, but I can't do the extrusion of a curve, I tried to make a sweep with 3 curves equal only translate m it gives me error.. .
How do you do, on sw 2010, to convert a curve in sketch on which you can work?
 
How do you do, on sw 2010, to convert a curve in sketch on which you can work?
open a 3d sketch and convert entities of that curve.
but if it is a path on a ground it will probably be on a floor and you can do it quietly even with a 2d sketch.

greetings
Mar
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top