#1
|
|||
|
|||
help needed
Thank you very much Mr. John,
I am really sorry that I did n't mentioned my problem. I am just beginer in Lisp. I am learning Lisp on my self. I want to create a code which extrudes/cuts a geometry/part on selected plane. i.e the dialog box should ask the plane (xy,yz,zx) on which the part to be generated/cut. I created a code for extrude/cut i.mean Mill. Is there any possibility to link the Postion_WP dialog box. Because, my part requires so many cuts, protrudes in defferent planes. every time I am changing the position of WP manually by using the command position_WP. Hope you 'll reply me soon. Once again thanks alot for reponding to mail. Regards Joseph |
#2
|
|||
|
|||
Hi Joseph,
Please have a look into the dialog generator manual: .../help/Common/documentation/integration_kit/reference/dg_manual.html#sd-defdialog In the section about 'Variable Specification' you get an overview about all possible options for a dialog variable (a button in the ui). Look for 'Activating Side Effects'. Here is the option :position-wp In chapter 4.1.6.3 Positioning Parts and Workplanes you get some more information about positioning workplanes. Hpe this helps! Dorothea |
#3
|
|||
|
|||
Thanks alot Mr Dorothea,
I got it. And now . . . I want to create a polygon which having all coordinates. But I have to draw that profile w.r.t the first(origin) point. i mean where ever I pick my mouse it would become the Origin and w.r.t that point remain all coordinates to be calculated. thanks you joseph |
#4
|
|||
|
|||
Hi Joseph,
Sorry, but I didn't get it. For better understanding please say it with example data. When you pick a point on the workplane this should be the start point of the polygon. Fine. And what after that? Do you pick another point or do you calculate the second point with respect to the first point? What is your question? Dorothea |
#5
|
|||
|
|||
Help
Yaah! Exactly
I fix the first point as Origin. the dialog box itself asks for the origin. But, I am defining the Origin as :value-type oint-2d. For other points I have exact calculations w.r.t the Origin. These values are in (x,y) type co-ordinates. For that I have to define the Origin in (x,y) co-ordinates. For e.g if you prepare a code for a line the first point it would ask in dialog box and the rest co-ordinates are fixed w.r.t the Origin. and the programme have to take those co-ordintes and draw the profile. Thanks joseph |
#6
|
|||
|
|||
Hi Joseph,
You can calculate with the positions using mathematical operations. In the documentation you find some information here: help/Common/documentation/integration_kit/reference/util_vec.html To get the x and y coordinates use the function (gpnt2d_x <a-2d-point>) For instance adding 10 in x direction can be done like this: (setf new_x (+ 10 (gpnt2d_x <a-2d-point>))) A new point can be created with (make-gpnt2d :x <x-value> :y <y-value>) These information can be found in the documentation I mentioned above. Hope this helps! Dorothea |
#7
|
|||
|
|||
Thanks very much for your immiediate reply. unfortunately, I am not getting you. That's why I am sending the image of the Profile.
Origin is to be Pick/enter any point on the screen. If the point is 3d-point then it is so much help ful. Mathematically I calulated, But I am not able to make a Code. Thanks Joseph |
#8
|
|||
|
|||
Hi Joseph,
I just write it down without testing exactly. But I hope you get the idea of how it could work. Assume you have a current workplane and a 2d point on this workplane (the origin). Now calculate the second point. There you should add the formulas visible in your image: x1 = x_origin +/- <delta> y1 = y_origin Now you have calculated x1 and y1 create the polygon: => (setf second_point (make-gpnt2d :x x1 :y y1)) (sd-call-cmds (POLYGON origin second_point)) Note: the code only works within a runnig dialog! Please refer the documentation about sd-call-cmds! Was this the missing piece you asked for? Dorothea |
#9
|
|||
|
|||
Hi Mr.Dorothea,
I have wrote a code for the profile earlier. Now I want half of the Profile with Co-ordinates. I am sending my previous code for your reference. Thanking you Joseph |
#10
|
|||
|
|||
Hi Joseph,
I get the feeling I had the same discussion already before, with the one you mentioned in your first posting, Mr.Jameshetfield. Please have a look at the old discussion "Lisp help needed" http://www.cocreateusers.org/forum/showthread.php?threadid=4933 Please avoid the same errors. With a first look I saw that the unit handling (internal units are radian and mm) is not correct in your code. Dorothea |
#11
|
|||
|
|||
Hi Mr. Dorothea,
you r correct. I thought that it is good task for me to make it out while learning lisp. I wrote a code and it is executed successfully. I prepared the code w.r.t the Internal Units only. I multiplied the angle with (pi/180) to change the degrees into radians. It is Ok. But, now my intension is to prepare a code w.r.t the co-ordinates. I have calculated the whole coordinates mathematically. The thing is I have to make a code which takes only one input i.e Origin and draws entire profile by taking other coordinates which we calculated Mathematicaly. Even I started writing this code by seeing Mr.James posts only. But, the Mathematical functions he used is quite different. Please help me. Thanks Joseph |
#12
|
|||
|
|||
Hi Joseph,
You don't need to convert into internal units when you use the correct :value-type for variables. There exist a number of different types which do already unit conversion for you. For instance the :value-type :angle returns any entered data from user units into internal units. Please have a look into documentation .../help/Common/documentation/integration_kit/reference/dg_manual.html#numbers If you have more questions, just ask. But I'm not going to do the calculation. This should be straight forward from the equations you have. Dorothea |
#13
|
|||
|
|||
Dear Mr.Dorothea,
Thanking you very much. I utilised ur code which sent in ur previous post and I succeed with that. I got it. one other thing is that While Generating profile I have to give coordinates in 2d (x,y). After that if I want to turn the profile without any dialog box. My code is (sd-call-cmds (turn art part :wp curr-wp :axis ???? :direction :rotation_angle 180)) Here I have to give a coordinate in 3d (x,y,z). the profile generating point and revolving axis'spoint should be same. In manual it is mentioned that we can change a 3d-point to 2d-point by (sd-gpnt3d-to-2d gpnt3d). How best I utilise this code to do so. Thank you very much. joseph |
#14
|
|||
|
|||
Hi Joseph,
Quote:
Quote:
Dorothea |
#15
|
|||
|
|||
Thanks Mr. Dorothea,
I have given the angle in radians. (sd-call-cmds (turn art part :wp curr-wp :axis ???? :direction :rotation_angle (* 180 (/ pi 180)))) my wp is curr-wp only. But, as I mentioned earlier my origin point is in 2d. It is not taking the point in turn command. If I give :value-type for Origin as oint-3d then the profile itself is not Generating. Becuase point is 3d point. If we turn maually, we have to give values for coordinate in 3d, axis plane & angle. For my profile it should be turned in curr-wp about "origin" point and in "V" plane. Thanks Joseph |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | Rate This Thread |
|
|