PDA

View Full Version : help needed


joseph_z
05-24-2004, 08:57 PM
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

dorothea
05-24-2004, 10:07 PM
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

joseph_z
05-25-2004, 03:01 AM
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

dorothea
05-25-2004, 04:01 AM
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

joseph_z
05-25-2004, 10:47 PM
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 :point-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

dorothea
05-25-2004, 11:00 PM
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

joseph_z
05-25-2004, 11:56 PM
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

dorothea
05-26-2004, 12:28 AM
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

joseph_z
05-26-2004, 02:22 AM
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

dorothea
05-26-2004, 05:05 AM
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

joseph_z
05-26-2004, 08:31 PM
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

dorothea
05-26-2004, 09:26 PM
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

joseph_z
05-26-2004, 10:43 PM
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 :part 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

dorothea
05-26-2004, 10:57 PM
Hi Joseph,

(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.

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

joseph_z
05-27-2004, 12:45 AM
Thanks Mr. Dorothea,
I have given the angle in radians.
(sd-call-cmds (turn :part 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 :point-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

dorothea
05-27-2004, 12:54 AM
Hi Joseph,

... and as I said you have to CALCULATE the axis point. I mentioned the workplane inquiries. Have you had a look into this documentation? There you see that the values returned are 3d points and vectors. Based on these data you can calculate the axis point.


Dorothea


BTW (* 180 (/ pi 180)) == pi

joseph_z
05-28-2004, 01:15 AM
Thank you Mr. Dorothea,
But, I don't why I am not able to do so.
my problem is How can I chage a 3d-point to 2d-point.
what is the code for it?

Can I sweep a geometry by giving two different paths at a time.

Thanks
Joseph

joseph_z
05-28-2004, 07:33 PM
Dear all,
Please any body help me in this reagard.

1. How can I chage a 3d-point to 2d-point.

2. I want to create a New Plane which is Perpediular to selected Face of my Part and that to I have to fix its origin by giving my coordinate.
i.e
If I select a face then the WP should come Perpedicular to the face and it should ask for a point for Origin of WP to be created.

clausb
05-29-2004, 01:41 AM
Joseph,

small hint: Dorothea is NOT a male name .-)

I'd second Dorothea's recommendation to first read the online documentation for the Integration Kit. You will probably find ways to improve your current code or attack the problem in a different way.

Claus

joseph_z
05-31-2004, 09:05 PM
Dear all,
Thaks to all of you, now I am able to write and execute aome tiny programmes now.
My dialog box should contain intially two variables.
Reactangle and Circle. If I click Rectangle button it should expand and show first point and end point.
where as Circle, it should give center point and radius (Here Ceter point of circle and first point of Rectangle are same)

and also there should be an option :mutual-exclusion bet'n circle and Rectangle.

In the case of expand-shrink I not able to use :mutual-exclusion.

Please suggest me what should I do.


Thanks you all people.

joseph_z
06-01-2004, 09:13 PM
Dear all,
Please help me any body.

PLEASE ..... PLEASE ......... PLEASE .............

clausb
06-01-2004, 09:27 PM
Again, why don't you simply read the documentation on sd-defdialog? If you go to the section on expand-shrink, you'll find explicit examples (including code) which show how to display different sets of variables depending on the value of other options/buttons. Simply adapt one of those examples to your needs.

Hope this helps,

Claus

John Scheffel
06-02-2004, 10:16 AM
Originally posted by joseph_z
Dear all,
Please help me any body.
PLEASE ..... PLEASE ......... PLEASE .............
I understand your frustration, learning LISP and Modeling customization is not easy, even for people with experience programming other languages.

However, you need to understand that nobody is getting paid to answer your questions here. Everyone posting here does so voluntarily, often on their own personal time. It takes a lot of time and effort to post answers to questions such as yours, and I think Dorothea did more than most people would have trying to help you. You can't expect someone to teach you LISP programming via this forum, or to write custom code on request.

If you can't figure it out from the documentation and whatever help you can get here, you may want to contact CoCreate about training. Another option is to contract the work out to an expert. CoCreate does have some customization services. You might also consider posting a note here asking if anyone would be willing to develop the code for a fee. Many of the people who follow this forum are independent contractors who might want the work.

joseph_z
06-08-2004, 07:53 PM
Dear Mr. John,
I really very sorry for making you so uneasy.
But, one thing that today I am making some programmes by using only yours favourable help. I am really happy that now I can able to write some codes. From now I realised that persons of this forum were sacrifised their so much valuable time for helping me in this regard.

I request you to please consider me as a child in LISP.
My employer is not at all interested in Customization of OSD.

When I am getting leisure time then I am learning and working on customisation part.

I don't know why I am really unable to get the Help from Documentation.

also I am not having any Programming backgroud. Still now I worked on OSD and AutoCAD.

Please suggest me in what way could I become a good Customiser of OSD.

I am awaiting for your reply . . .

Joseph

clausb
06-08-2004, 09:31 PM
Not sure if I understand you correctly - are you saying that online help does not work with your installation of OSDM?

The online documentation on the Integration Kit (or "Developer Kit", as it is called now) is really your best source for information. In addition, there are plenty of resources on LISP out there on the 'net. My favorite recommendations are:


Lamkins: Successful LISP (http://www.psg.com/~dlamkins/sl/cover.html)
Common LISP Hyperspec (http://www.lisp.org/HyperSpec/FrontMatter/index.html) (LISP reference)


These are the sources I would consult first for learning more. There are, of course, also good commercial books on learning LISP. Amazon lists about 10 books on Common LISP; Paul Graham's "ANSI Common LISP" is probably not a bad choice if you don't have much programming background.

Claus

John Scheffel
06-09-2004, 09:37 AM
Originally posted by joseph_z
Please suggest me in what way could I become a good Customiser of OSD.
If formal training or contracting is not an option, then I have no suggestions beyond those made by Claus and Dorothea. The standard Modeling install provides lots of documentation on the Integration Kit and writing customizations in LISP, but it is mostly reference type information and not that easy to learn from. To access this documentation, click Help, On Product, then scroll down to the "OneSpace Designer Developers Kit" link. The documentation files are located under:

<install-dir>\help\Common\documentation\integration_kit\

So you can search this folder using standard Windows "find files containing text" options to find documentation on specific commands.

CoCreate does teach a formal class on this topic. If you cannot take the class, you might want to contact your CoCreate representative about obtaining the class materials. This might be the best self training option.

You are free to continue asking questions here, but as I said you will have to understand if nobody answers since it is all voluntary. If you have a support contract with CoCreate, you can always submit your questions through those channels in which case someone is getting paid to respond.

joseph_z
06-14-2004, 10:45 PM
Mr.James,
Thanks for the suggestion and I am trying to get the material from our CoCreate Representative.

One thing... what is Dynamic Relations Module.
I have seen in OSD but it is having so many other modules but it is not there. is it a Module or a different interface.
Please tell me any body.

dorothea
06-15-2004, 06:16 AM
Hello Joseph,

You can find some information in the help under the following link:

.../help/english/pesd.ht/concept/sdcdynrl.html


Hope this helps,
Dorothea

John Scheffel
06-15-2004, 01:37 PM
Originally posted by joseph_z
One thing... what is Dynamic Relations Module
Dynamic Relations is the old name for what is now the "Assembly" Module. It is a way to define relationships between parts in an assembly so that if one part moves the rest will move according to those relationships. It can be used to do simple mechanism simulation, but is not a true Kinematic analysis tool.

There is also a "Parametrics" Module which allows similar relationships to be defined between features (faces, edges, etc) within a single part.

Both of these can be activated from Application, Modules but require a separate module license. See the file indicated by Dorothea for more details.