CoCreate User Forum  

Go Back   CoCreate User Forum > Support > Customization

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 05-24-2004, 08:57 PM
joseph_z joseph_z is offline
Registered User
 
Join Date: May 2004
Posts: 47
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
Reply With Quote
  #2  
Old 05-24-2004, 10:07 PM
dorothea dorothea is offline
Registered User
 
Join Date: Nov 2002
Location: Nufringen near Stuttgart
Posts: 157
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
Reply With Quote
  #3  
Old 05-25-2004, 03:01 AM
joseph_z joseph_z is offline
Registered User
 
Join Date: May 2004
Posts: 47
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
Reply With Quote
  #4  
Old 05-25-2004, 04:01 AM
dorothea dorothea is offline
Registered User
 
Join Date: Nov 2002
Location: Nufringen near Stuttgart
Posts: 157
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
Reply With Quote
  #5  
Old 05-25-2004, 10:47 PM
joseph_z joseph_z is offline
Registered User
 
Join Date: May 2004
Posts: 47
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
Reply With Quote
  #6  
Old 05-25-2004, 11:00 PM
dorothea dorothea is offline
Registered User
 
Join Date: Nov 2002
Location: Nufringen near Stuttgart
Posts: 157
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
Reply With Quote
  #7  
Old 05-25-2004, 11:56 PM
joseph_z joseph_z is offline
Registered User
 
Join Date: May 2004
Posts: 47
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
Attached Files
File Type: zip profile.zip (28.2 KB, 417 views)
Reply With Quote
  #8  
Old 05-26-2004, 12:28 AM
dorothea dorothea is offline
Registered User
 
Join Date: Nov 2002
Location: Nufringen near Stuttgart
Posts: 157
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
Reply With Quote
  #9  
Old 05-26-2004, 02:22 AM
joseph_z joseph_z is offline
Registered User
 
Join Date: May 2004
Posts: 47
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
Attached Files
File Type: lsp latest_1.lsp (1.3 KB, 372 views)
Reply With Quote
  #10  
Old 05-26-2004, 05:05 AM
dorothea dorothea is offline
Registered User
 
Join Date: Nov 2002
Location: Nufringen near Stuttgart
Posts: 157
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
Reply With Quote
  #11  
Old 05-26-2004, 08:31 PM
joseph_z joseph_z is offline
Registered User
 
Join Date: May 2004
Posts: 47
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
Reply With Quote
  #12  
Old 05-26-2004, 09:26 PM
dorothea dorothea is offline
Registered User
 
Join Date: Nov 2002
Location: Nufringen near Stuttgart
Posts: 157
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
Reply With Quote
  #13  
Old 05-26-2004, 10:43 PM
joseph_z joseph_z is offline
Registered User
 
Join Date: May 2004
Posts: 47
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
Reply With Quote
  #14  
Old 05-26-2004, 10:57 PM
dorothea dorothea is offline
Registered User
 
Join Date: Nov 2002
Location: Nufringen near Stuttgart
Posts: 157
Hi Joseph,

Quote:
(sd-call-cmds (turn :part part :wp curr-wp :axis ???? :direction
:rotation_angle 180))
The system works in INTERNAL units. This is radian for an angle. Therefore 180 is not correct.

Quote:
Here I have to give a coordinate in 3d (x,y,z).
the profile generating point and revolving axis'spoint should be same.
Where is the origin of the workplane? Either you have created it at a certain position or you select an existing workplane. There exist inquiries for workplanes (.../reference/inq_wp.htm). I'd suggest to take the origin and normal of the workplane and then calculate the axis out of these data. You know the position in 2d which is in the workplane. So you should be able to get the axis position out of workplane data and profile data.



Dorothea
Reply With Quote
  #15  
Old 05-27-2004, 12:45 AM
joseph_z joseph_z is offline
Registered User
 
Join Date: May 2004
Posts: 47
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
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 12:53 AM.



Hosted by SureServer    Forums   Modeling FAQ   Macro Site   Vendor/Contractors   Software Resellers   CoCreate   Gallery   Home   Board Members   Regional User Groups  By-Laws  

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.