Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

3D vector field

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
Alas_1234
493 Views, 8 Replies

3D vector field

Hi,

 

I have data consist of X(x coordinate) Y(y coordinate) Z(z coordinate)

                                       U(Vector_x)   V(Vector_y)  W(Vector_z)

 

XYZ is the coordinate of the points

UVW is the component of the vector

 

I try to draw leader  in autocad 3d with given data like below example:

 

Alas_1234_1-1671914239393.png

 

Which code I need to create vector field similar this image? Thank you.

 

Note: I uploaded to data as an attachment

 

 

 

 

8 REPLIES 8
Message 2 of 9
hosneyalaa
in reply to: Alas_1234

hi

by dynamo ....

 

11.gif

 

 

9.JPG

 

 

12.gif

Message 3 of 9
Alas_1234
in reply to: hosneyalaa

Hi,

I haven't used dynamo before. How I get this result could you give more detail please?

Thanks.

Message 4 of 9
hosneyalaa
in reply to: Alas_1234

have you  civil 3d  program

 

8.JPG

 

 

Message 5 of 9
hosneyalaa
in reply to: hosneyalaa

@Alas_1234 

this file

Message 6 of 9
yangguoshe
in reply to: Alas_1234

Hello! Mr. Alas_  1234, the relative speed of motion should be considered in this case? It is drawn according to the difference of speed in different directions. I don't know whether it is true or not,thanks! tyu5677.gif

Message 7 of 9
Alas_1234
in reply to: yangguoshe

Hi, could you upload source file? I want to know how to do it. Thanks.

Message 8 of 9
yangguoshe
in reply to: Alas_1234

 

 I don't know if this is right, it's just my idea

(defun c:ttt(/ DOC H HGT LST MSPACE PT1 QD RAD SJ SL ZD0 newlst)
  (if(not newlst)
     (setq newlst'(("x" "y" "z" "vx (bar)" "vy (bar)" "vz (bar)") ("m" "m" "m" "m/s" "m/s" "m/s") (0.1 1.8 0.05 4.01266 -15.8332 -9.36775) (0.1 1.5 0.05 13.4812 -24.2331 -10.0447) (0.1 1.2 0.05 14.3948 -31.0624 -8.5171) (0.1 0.9 0.05 14.2675 -32.4355 -7.50354) (0.1 0.6 0.05 10.0316 -20.2 -4.13697) (0.1 0.3 0.05 171.907 65.511 -0.0299667) (0.1 0.2 0.05 176.02 63.7834 -9.14684) (0.1 1.8 0.18 -14.9177 -10.9329 -11.3376) (0.1 1.5 0.18 -3.7091 -29.8877 -13.0536) (0.1 1.2 0.18 1.75634 -32.8954 -15.1261) (0.1 0.9 0.18 5.37353 -31.7826 -11.9146) (0.1 0.6 0.18 9.81205 -26.191 -8.53649) (0.1 0.3 0.18 181.582 69.9415 -4.89278) (0.1 0.2 0.18 182.572 73.9105 -9.40557) (0.1 1.8 0.31 -16.1963 -13.816 -7.32248) (0.1 1.5 0.31 -5.8118 -31.1896 -14.5778) (0.1 1.2 0.31 -3.16008 -34.27 -16.114) (0.1 0.9 0.31 -0.0933777 -33.9323 -10.3892) (0.1 0.6 0.31 4.79709 -26.1382 -5.81879) (0.1 0.3 0.31 175.275 74.5037 -17.0276) (0.1 0.2 0.31 177.902 79.6852 -13.5399) (0.1 1.8 0.44 -15.7046 -15.9825 -7.58519) (0.1 1.5 0.44 -9.54995 -34.6884 -7.2127) (0.1 1.2 0.44 -8.72666 -39.6471 -11.2613) (0.1 0.9 0.44 -4.28458 -33.4866 -8.25025) (0.1 0.6 0.44 3.1673 -26.1371 -4.22446) (0.1 0.3 0.44 139.624 77.4617 -17.8467) (0.1 0.2 0.44 146.02 81.1256 -17.6265) (0.3 1.8 0.05 2.16814 -19.9629 4.42095) (0.3 1.5 0.05 13.6484 -23.4928 3.51248) (0.3 1.2 0.05 30.642 -23.3532 -1.03384) (0.3 0.9 0.05 27.1358 -25.2079 -2.9584) (0.3 0.6 0.05 29.3495 -21.5573 -1.00221) (0.3 0.3 0.05 178.407 28.1677 -17.5715) (0.3 0.2 0.05 27.7614 20.0668 3.42476) (0.3 0.1 0.05 -19.0762 14.0505 3.54774) (0.3 1.8 0.18 -24.5313 -15.9644 6.76862) (0.3 1.5 0.18 -6.93787 -26.5181 2.71486) (0.3 1.2 0.18 2.24198 -29.4821 -4.69948) (0.3 0.9 0.18 11.1087 -25.6682 -5.26572) (0.3 0.6 0.18 20.6281 -16.4494 -1.92552) (0.3 0.3 0.18 189.23 38.4926 -10.6648) (0.3 0.2 0.18 26.5745 17.0965 -4.44116) (0.3 0.1 0.18 -8.35691 19.0775 3.02637) (0.3 1.8 0.31 -17.9022 -16.0553 0.282662) (0.3 1.5 0.31 -8.90671 -25.9383 -4.15579) (0.3 1.2 0.31 -2.93932 -30.3014 -7.14855) (0.3 0.9 0.31 1.89088 -25.0243 -5.55163) (0.3 0.6 0.31 14.8954 -13.5546 -3.01403) (0.3 0.3 0.31 177.121 42.3227 -10.054) (0.3 0.2 0.31 18.3533 16.3915 -6.71784) (0.3 0.1 0.31 -12.8809 15.5294 -5.08709) (0.3 1.8 0.44 -29.0698 -17.8513 -0.293261) (0.3 1.5 0.44 -19.4003 -27.053 -4.03814) (0.3 1.2 0.44 -13.5431 -27.585 -4.45747) (0.3 0.9 0.44 -2.78509 -24.7114 -3.30013) (0.3 0.6 0.44 31.9704 4.5181 -3.92473) (0.3 0.3 0.44 -3.81188 -3.20627 -2.51461) (0.3 0.2 0.44 29.8898 14.1694 -15.9023) (0.3 0.1 0.44 -24.4035 12.9909 0.967654) (0.6 1.8 0.05 -25.3946 -8.94501 2.55872) (0.6 1.5 0.05 1.44815 -16.4873 2.50484) (0.6 1.2 0.05 24.2584 -18.2482 -0.666789) (0.6 0.9 0.05 33.4609 -14.4839 0.151314) (0.6 0.6 0.05 37.3675 -12.8667 -0.258403) (0.6 0.3 0.05 155.514 -7.80544 -14.3827) (0.6 0.2 0.05 86.271 -10.1931 -4.85406) (0.6 0.1 0.05 -11.9511 -9.5283 5.35641) (0.6 1.8 0.18 -20.4778 -3.15173 2.91651) (0.6 1.5 0.18 -5.511 -13.9906 1.08681) (0.6 1.2 0.18 11.9607 -21.4737 3.9501) (0.6 0.9 0.18 18.5026 -18.9982 0.371331) (0.6 0.6 0.18 31.2325 -15.0722 -2.98521) (0.6 0.3 0.18 163.724 -6.73597 -10.183) (0.6 0.2 0.18 66.8036 -5.83516 -6.51676) (0.6 0.1 0.18 -10.7178 -5.59842 -2.26607) (0.6 1.8 0.31 -29.3759 -10.9149 2.89641) (0.6 1.5 0.31 -10.8294 -15.1387 -1.11877) (0.6 1.2 0.31 -0.0689684 -15.5691 -1.62642) (0.6 0.9 0.31 10.004 -17.7069 -1.77562) (0.6 0.6 0.31 51.1493 -2.89908 -3.88777) (0.6 0.3 0.31 166.791 -0.865291 -11.944) (0.6 0.2 0.31 80.0313 -4.06316 -14.5868) (0.6 0.1 0.31 -14.2607 -3.1911 0.787537) (0.6 1.8 0.44 -44.4974 -17.1026 3.50454) (0.6 1.5 0.44 -26.7889 -21.5732 -0.815175) (0.6 1.2 0.44 -13.4002 -19.7947 -2.00627) (0.6 0.9 0.44 -2.26564 -12.9649 -0.735907) (0.6 0.6 0.44 93.8691 23.0843 3.768) (0.6 0.3 0.44 73.1782 17.2315 -5.50581) (0.6 0.2 0.44 23.2159 2.52679 -0.147088) (0.6 0.1 0.44 -39.1348 5.61684 5.88913) (0.9 1.8 0.05 -45.1727 -5.6806 1.26586) (0.9 1.5 0.05 -10.4839 -3.81521 1.56862) (0.9 1.2 0.05 15.5541 -8.15582 0.567171) (0.9 0.9 0.05 33.1263 -9.58676 2.01624) (0.9 0.6 0.05 41.1173 -12.7864 -0.546772) (0.9 0.3 0.05 115.323 -21.6475 -12.6877) (0.9 0.2 0.05 97.9234 -18.6203 -6.92646) (0.9 0.1 0.05 21.3229 -12.9704 4.24777) (0.9 1.8 0.18 -35.1307 2.40346 3.44737) (0.9 1.5 0.18 -8.24067 -2.71093 -0.532047) (0.9 1.2 0.18 6.76576 -7.17552 -3.74043) (0.9 0.9 0.18 21.9878 -14.0947 1.75537) (0.9 0.6 0.18 30.1454 -17.5014 -0.933295) (0.9 0.3 0.18 136.79 -18.0007 -4.40734) (0.9 0.2 0.18 107.303 -22.5804 -2.71474) (0.9 0.1 0.18 39.5556 -15.051 8.62504) (0.9 1.8 0.31 -41.8097 -7.91265 3.89188) (0.9 1.5 0.31 -15.7897 -6.31511 -0.412047) (0.9 1.2 0.31 -3.00752 -5.84742 -3.78837) (0.9 0.9 0.31 13.9903 -10.6815 0.991597) (0.9 0.6 0.31 51.0571 -9.33958 -1.77569) (0.9 0.3 0.31 141.665 -7.13496 -0.0186855) (0.9 0.2 0.31 91.3056 -18.4445 -3.34438) (0.9 0.1 0.31 22.7442 -11.7768 19.0123) (0.9 1.8 0.44 -46.0486 -16.1932 6.53697) (0.9 1.5 0.44 -22.739 -2.09819 0.568013) (0.9 1.2 0.44 -13.2772 -13.8274 -3.95468) (0.9 0.9 0.44 5.49323 -9.37481 -1.98456) (0.9 0.6 0.44 87.7017 9.98185 5.75309) (0.9 0.3 0.44 60.5341 -2.11507 5.67161) (0.9 0.2 0.44 11.3656 -4.21145 1.10398) (0.9 0.1 0.44 -19.1308 5.86271 16.3703) (1.2 1.8 0.05 -41.7025 5.59894 3.57097) (1.2 1.5 0.05 -18.1754 10.9313 2.53834) (1.2 1.2 0.05 6.28443 4.61725 3.39903) (1.2 0.9 0.05 18.7852 -1.08018 2.51722) (1.2 0.6 0.05 26.0837 0.683777 3.36817) (1.2 0.3 0.05 72.2651 -5.63283 -2.0879) (1.2 0.2 0.05 94.1209 -10.5434 -2.74686) (1.2 0.1 0.05 67.7652 -19.1056 14.4331) (1.2 1.8 0.18 -35.117 9.8323 6.64032) (1.2 1.5 0.18 -17.3267 13.4578 6.54225) (1.2 1.2 0.18 5.62551 2.56918 3.81602) (1.2 0.9 0.18 19.4076 -4.85885 4.97594) (1.2 0.6 0.18 32.0502 -9.31832 1.53331) (1.2 0.3 0.18 98.0341 -10.8812 1.48812) (1.2 0.2 0.18 113.846 -16.1319 2.35642) (1.2 0.1 0.18 76.1684 -11.8418 15.3602) (1.2 1.8 0.31 -38.784 -5.00193 9.96027) (1.2 1.5 0.31 -13.9098 5.89764 4.51874) (1.2 1.2 0.31 -3.4201 0.705624 2.23458) (1.2 0.9 0.31 12.5729 -3.66359 3.60033) (1.2 0.6 0.31 51.1973 -4.17012 1.5406) (1.2 0.3 0.31 110.542 -9.90834 5.78266) (1.2 0.2 0.31 94.3214 -14.5367 5.87572) (1.2 0.1 0.31 60.1295 -10.8254 24.4186) (1.2 1.8 0.44 -47.3187 -19.4488 11.4042) (1.2 1.5 0.44 -21.4175 -5.27165 1.56674) (1.2 1.2 0.44 -11.0179 -3.47948 -1.5278) (1.2 0.9 0.44 11.5317 2.82456 3.54125) (1.2 0.6 0.44 74.5447 4.79276 5.12612) (1.2 0.3 0.44 76.5808 -5.28087 8.18739) (1.2 0.2 0.44 31.3984 -8.54339 4.59078) (1.2 0.1 0.44 24.3388 -4.53077 22.3975) (1.5 1.8 0.05 -42.5564 20.57 4.03962) (1.5 1.5 0.05 -37.7512 31.8096 3.8403) (1.5 1.2 0.05 -30.5697 28.0712 6.73634) (1.5 0.9 0.05 -7.25988 24.539 4.06972) (1.5 0.6 0.05 16.3837 16.0997 0.74376) (1.5 0.3 0.05 79.139 16.9269 15.9951) (1.5 0.2 0.05 93.1127 7.77007 10.6177) (1.5 0.1 0.05 35.4672 2.09494 0.826356) (1.5 1.8 0.18 -32.1287 10.705 9.51253) (1.5 1.5 0.18 -16.6403 23.6086 3.11705) (1.5 1.2 0.18 -5.62612 29.2083 10.4433) (1.5 0.9 0.18 12.2888 16.4843 9.30023) (1.5 0.6 0.18 28.1825 6.93193 4.04093) (1.5 0.3 0.18 82.5464 3.03998 1.4203) (1.5 0.2 0.18 99.3032 -4.54902 2.58308) (1.5 0.1 0.18 99.5284 -1.77953 5.81696) (1.5 1.8 0.31 -36.8728 -8.16095 18.1939) (1.5 1.5 0.31 -9.01225 6.1876 3.71153) (1.5 1.2 0.31 3.01542 13.536 5.86581) (1.5 0.9 0.31 15.9323 9.26696 8.26852) (1.5 0.6 0.31 46.821 8.69968 1.17396) (1.5 0.3 0.31 93.1485 0.715491 2.08576) (1.5 0.2 0.31 94.2922 -6.37106 4.19814) (1.5 0.1 0.31 80.4712 -6.72286 18.5356) (1.5 1.8 0.44 -35.5293 -11.7662 15.1696) (1.5 1.5 0.44 -9.97692 -1.92346 1.38587) (1.5 1.2 0.44 0.612845 1.4407 -0.330316) (1.5 0.9 0.44 20.3732 11.4727 4.79884) (1.5 0.6 0.44 67.3764 12.7777 2.36346) (1.5 0.3 0.44 71.2754 0.287903 3.3393) (1.5 0.2 0.44 56.0178 -3.41632 7.18524) (1.5 0.1 0.44 56.2188 -2.72328 19.9189) (1.8 1.8 0.05 -32.3626 40.7753 -1.18458) (1.8 1.5 0.05 -29.0326 56.3436 -1.02948) (1.8 1.2 0.05 -37.6296 56.3887 1.01101) (1.8 0.9 0.05 -33.4361 48.9028 0.0820965) (1.8 0.6 0.05 1.10023 25.3117 -9.95551) (1.8 0.3 0.05 69.4782 13.3961 -7.44298) (1.8 0.2 0.05 94.856 12.6098 -4.52153) (1.8 0.1 0.05 76.5482 4.84727 -18.0354) (1.8 1.8 0.18 -27.5254 22.1848 5.68476) (1.8 1.5 0.18 -6.53428 33.948 -5.15235) (1.8 1.2 0.18 -5.78865 44.7145 -10.8274) (1.8 0.9 0.18 2.27729 44.6678 -13.6032) (1.8 0.6 0.18 24.6151 32.4816 -13.2363) (1.8 0.3 0.18 74.1432 -0.782013 -5.70354) (1.8 0.2 0.18 97.5704 8.15431 -5.89135) (1.8 0.1 0.18 98.7439 4.99128 -8.26263) (1.8 1.8 0.31 -23.5835 16.6368 7.31804) (1.8 1.5 0.31 1.16677 26.4821 -3.58459) (1.8 1.2 0.31 6.25885 36.0005 -8.16413) (1.8 0.9 0.31 12.9679 42.279 -10.9632) (1.8 0.6 0.31 39.7969 33.41 -17.3772) (1.8 0.3 0.31 83.1587 -1.89889 -7.55428) (1.8 0.2 0.31 89.9674 2.73792 -2.76087) (1.8 0.1 0.31 88.2603 2.2827 2.32416) (1.8 1.8 0.44 -17.5855 15.7469 6.75691) (1.8 1.5 0.44 2.32569 27.8324 0.240349) (1.8 1.2 0.44 7.65015 37.6351 -3.1627) (1.8 0.9 0.44 21.3532 41.082 -10.4622) (1.8 0.6 0.44 52.2476 34.8723 -12.2085) (1.8 0.3 0.44 68.1741 -2.58055 -6.68015) (1.8 0.2 0.44 65.4351 -0.928686 -1.97514) (1.8 0.1 0.44 61.5605 4.01552 9.82052)))
  )
 (setq lst(cddr newlst) 
          doc(vla-get-activedocument(vlax-get-acad-object)) 
          mspace (vla-get-modelspace doc) 
          sj 0.00075 hgt 1.88294) 
(while(car lst)
  (setq h(car lst) 
         qd(list(car h)(cadr h)(caddr h)) 
         sl(list(cadddr h)(nth 4 h) (last h)) 
         zd0(mapcar'+ (mapcar '* sl(list sj sj sj)) qd))
   (entmake (list '(0 . "line") (cons 10 qd) (cons 11 zd0) ))
   (setq pt1(vlax-3d-point  zd0)  
         rad(/ 1.88294 1000)) 
   (vla-addSPHERE mspace pt1 rad) 
   (setq lst(cdr lst))
 )
)

 

Message 9 of 9
Alas_1234
in reply to: yangguoshe

It works. How you copy excel datas to notepad? When I copy from excel  the format be different from your  style.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

State of Sustainability Webinar


AutoCAD Inside the Factory