CoCreate User Forum  

Go Back   CoCreate User Forum > Support > Customization

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 04-06-2009, 01:02 AM
Yoyovento Yoyovento is offline
Registered User
 
Join Date: Apr 2009
Posts: 31
Talking Rotate selected part with a list prog

Morning,

That's first time, I'm trying to prog into OSD. I can't select the part and the axis with a dialog box.
I've used the get_selection but still error message.
To resume, a part is on my screen and I want to rotate it around an axis I'll select.


Someone to help me ?
Reply With Quote
  #2  
Old 04-06-2009, 01:19 AM
Yoyovento Yoyovento is offline
Registered User
 
Join Date: Apr 2009
Posts: 31
Re: Rotate selected part with a list prog

The main difficulty is the vlue_type for an axis I guess
Reply With Quote
  #3  
Old 04-06-2009, 01:32 AM
Yoyovento Yoyovento is offline
Registered User
 
Join Date: Apr 2009
Posts: 31
Re: Rotate selected part with a list prog

It'll be wonderfull if the axis will be selected when I select a cylinder.
Reply With Quote
  #4  
Old 04-06-2009, 01:59 AM
Yoyovento Yoyovento is offline
Registered User
 
Join Date: Apr 2009
Posts: 31
Re: Rotate selected part with a list prog

hey hey perhaps ":measure-axis"
Reply With Quote
  #5  
Old 04-06-2009, 06:02 AM
Yoyovento Yoyovento is offline
Registered User
 
Join Date: Apr 2009
Posts: 31
Re: Rotate selected part with a list prog

please help me, I'll be crazy, 4 hours on this
I can't select an axis to rotate a part
Reply With Quote
  #6  
Old 04-06-2009, 07:07 AM
clausb's Avatar
clausb clausb is offline
Registered User
 
Join Date: Nov 2002
Posts: 1,168
Re: Rotate selected part with a list prog

Can you show us in a little more detail what you're trying to do? Do you have a code sample for us?

Thanks,

Claus
__________________
CoCreate Modeling FAQ: http://www.clausbrod.de/CoCreateModeling/
Reply With Quote
  #7  
Old 04-06-2009, 10:08 PM
Yoyovento Yoyovento is offline
Registered User
 
Join Date: Apr 2009
Posts: 31
Re: Rotate selected part with a list prog

Ok, I want to rotate 2 parts and substract one each time.
So I need choose 2 parts and 2 axis of rotation.



My code is :

(in-package :sdtbtools )
(sd-defdialog 'Yo
:dialog-title "Yo"
:toolbox-button t
:variables
'( ("-")
(Part1 :initial-enable t :initial-optional nil :initial-value nil :title "Part1" :value-type :part :multiple-items nil)
(ax1 :value-type :sd_presel_edge.pum :title "Ax rotation Part1")
(Part2 :initial-enable t :initial-optional nil :initial-value nil :title "Part2" :value-type :part :multiple-items nil)
(ax2 :value-type :edge_3d :title "Ax rotation Part2"))

:ok-action '(sd-call-cmds (progn (taill Part1 Part2 ax1 ax2))) ;lance le prog
:help-action '(sd-display-url "http://intranet:1080/aidecao/macros_speciales/implant_help.pdf") :toolbox-button nil )
;

(defun taill(Part1 Part2 ax1 ax2) ;partie prog
;(subtract_3d :blanks (sd-inq-obj-pathname Part1) :tools (sd-inq-obj-pathname Part2) :keep_tool :yes)
(dotimes (c 10 'done)
(position_pa :part_assembly Part1 :rotate :axis :ax1 :rotation_angle 5 :done)
(position_pa :part_assembly Part2 :rotate :axis :ax2 :rotation_angle 5 :done)
(subtract_3d :blanks (sd-inq-obj-pathname Part1) :tools (sd-inq-obj-pathname Part2) :keep_tool :yes) ) )


hope this help you
Reply With Quote
  #8  
Old 04-07-2009, 06:51 AM
MichaelA MichaelA is offline
Registered User
 
Join Date: Feb 2006
Location: Vancouver, WA USA
Posts: 40
Re: Rotate selected part with a list prog

here is a code set that subtracts or unites 1 tool to a body while rotating the tool around a single axis. might give you the necessary info to complete your version.

enjoy,

Michael
Attached Files
File Type: lsp rotate_unite_or_subtract.lsp (2.0 KB, 284 views)
Reply With Quote
  #9  
Old 04-08-2009, 12:26 AM
Yoyovento Yoyovento is offline
Registered User
 
Join Date: Apr 2009
Posts: 31
Re: Rotate selected part with a list prog

Many thanks for your help. So I copied and pasted it in Notepad++, save it with lisp format and try to load it on OSD and I get this message :

Reply With Quote
  #10  
Old 04-08-2009, 01:06 AM
Yoyovento Yoyovento is offline
Registered User
 
Join Date: Apr 2009
Posts: 31
Re: Rotate selected part with a list prog

Ok I've modified my code set :


(in-package :sdtbtools )
(sd-defdialog 'Yo
:dialog-title "Yo"
:toolbox-button t
:variables

'( ("-")
(Part1 :initial-enable t :initial-optional nil :initial-value nil :title "Part1" :value-type art :multiple-items nil)
(ax1 :value-type :measure-axis :title "Ax rotation Part1")
(Part2 :initial-enable t :initial-optional nil :initial-value nil :title "Part2" :value-type art :multiple-items nil)
(ax2 :value-type :measure-axis :title "Ax rotation Part2"))

k-action '(sd-call-cmds (progn (taill Part1 Part2 ax1 ax2))) ;lance le prog
:help-action '(sd-display-url "http://intranet:1080/aidecao/macros_speciales/implant_help.pdf") :toolbox-button nil )
;

(defun taill(Part1 Part2 ax1 ax2) ;partie prog
;(subtract_3d :blanks (sd-inq-obj-pathname Part1) :tools (sd-inq-obj-pathname Part2) :keep_tool :yes)
(dotimes (c 36 'done)
(sd-call-cmds (position_pa Part1 :rotate :axis (first ax1) (second ax1) :rotation_angle 10 :done))
(sd-call-cmds (position_pa Part2 :rotate :axis (first ax2) (second ax2) :rotation_angle 10 :done))
;(position_pa art_assembly Part2 :rotate :axis :ax2 :rotation_angle 5 :done)
(subtract_3d :blanks (sd-inq-obj-pathname Part1) :tools (sd-inq-obj-pathname Part2) :keep_tool :yes) ) )


It works but results are not results wished, well, just a question why do you used ":axis (first ax1) (second ax1)" ?, why first and second ?
Reply With Quote
  #11  
Old 04-08-2009, 03:23 AM
Yoyovento Yoyovento is offline
Registered User
 
Join Date: Apr 2009
Posts: 31
Re: Rotate selected part with a list prog

results are correct know, it was my fault, mistake between deg and rad lol

many thanks, issue solved
Reply With Quote
  #12  
Old 04-08-2009, 04:41 AM
Yoyovento Yoyovento is offline
Registered User
 
Join Date: Apr 2009
Posts: 31
Re: Rotate selected part with a list prog

someone knows how to show steps each 10 times for example ?
Reply With Quote
  #13  
Old 04-08-2009, 11:13 AM
Wolfgang's Avatar
Wolfgang Wolfgang is offline
Registered User
 
Join Date: Nov 2002
Location: ... near Sindelfingen near Stuttgart, Germany
Posts: 754
Re: Rotate selected part with a list prog

when posting code its quite useful to use the code code
Code:
(sd-defdialog 'Yo
  :dialog-title "Yo"
  :toolbox-button t
  :variables
when posting several lines of code its quite useful to attach it as an attachment (= file) This also saving time for those willing to help you. Because downloading file, loading in editor, loading in OSDM is easier that way. And it's more save then copy and paste.

Just hints for better communication. Fine that we know that your problem is solved.
Reply With Quote
  #14  
Old 04-09-2009, 12:36 AM
Yoyovento Yoyovento is offline
Registered User
 
Join Date: Apr 2009
Posts: 31
Re: Rotate selected part with a list prog

I appreciate...thanks for the tip...
Reply With Quote
  #15  
Old 04-09-2009, 05:48 AM
MichaelA MichaelA is offline
Registered User
 
Join Date: Feb 2006
Location: Vancouver, WA USA
Posts: 40
Re: Rotate selected part with a list prog

Quote:
Originally Posted by Yoyovento View Post
Ok I've modified my code set :


It works but results are not results wished, well, just a question why do you used ":axis (first ax1) (second ax1)" ?, why first and second ?
so the value of the variable ax1 is a list and to specify the info for the :axis option you need both the first object in the list and the second. you will see what I mean if you do some display of the first and second parts of the ax1 list. yet another interesting thing with lisp programming.

glad you got yours working.

Michael
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:44 PM.



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.