PDA

View Full Version : Edge Selection


sstaabs
10-27-2005, 12:31 PM
Face Selection
Hi
I am trying to select the edge of a sheet metal part,which is is created using lisp.

This is what I Recorded in OSDM, But instead of screen selection of the edge of the Part is there a way to select the edge.

SHA_ADD_LIP
:lip_edge
(gpntwc 551.441114 503.157932 20.141571 "vport1")
:lip_angle
120.000000000000000
:lip_length
3.000000000000000
set_pers_context "LIP_RIGHT_RELIEF_PERS_CONTEXT"
:right_dist
-4.655000000000000
:right_automatic :off
:left_automatic :off
:left_relief
:NONE
:right_relief
:BEND-RELIEF
complete
preselect
;%RECORDING-END at 09:15:17 10/27/2005

These values are in inches, however when I run the program to create the part, the value has be in millimeters.

Also I get an error message when I try to create the lip in Sheet Metal.

See screen capture. I believe that this is caused by using the basic add lip command instead of the Sheet Metal add lip command. I do not understand how to give all the parameters to get the command to work.

Thanks in advance,

Steve

dorothea
10-27-2005, 10:05 PM
Hi Steve,

I don't know anything about this particular Sheet Metal command. But a general hint:

For units conversion use the command 'sd-user-to-sys-units'. This converts for instance from inch to mm. If you are working with sd-call-cmds you need to pass the values as internal units - in this case mm.

For verification if your positions are correct add some debugging code to your lisp file. For instance use the pnt3 to create a sel_item of an edge (get_selection like you first line in the lisp file). Just print the result of get_selection to see if an edge was hit or not.

Sorry, I have not more to say.
Dorothea

sstaabs
10-31-2005, 04:28 AM
Hello Dorothea,


In a previous thread you replied with this response.
http://www.cocreateusers.org/forum/showthread.php?t=4978

setf point 1.0,1.0,0.0)
(setf face
(sd-call-cmds
(get_selection
focus_type *sd-face-seltype*
:select :selected_part <the part sel item>
point)))


What does the <the part sel item> mean and how do I specify this?

I am sorry, I am still trying to learn Lisp and I don't understand how to select an edge programatically. I can get it to pick a face but not an edge.

Thanks,

Steve

dorothea
10-31-2005, 04:37 AM
Hi Steve,

<the part sel item> is a place holder for and sel_item of a part. How to get such a part depends on the data you have. You get the sel_item of parts by different methods:
* dialog variable of :value-type :part
* get_selection with focus_type *sd-part-seltype*
* sd-pathname-to-obj

There are more available in Developers Kit. But the important thing is to know which data are available. Do you have the part in your example? From looking at the lisp file I think you have. It's the name you specify for sheet part creation. So you could use the developers kit function sd-pathname-to-obj.

Hope this helps,
Dorothea