CoCreate User Forum  

Go Back   CoCreate User Forum > Support > Customization

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 06-15-2010, 05:50 AM
Maximus172 Maximus172 is offline
Registered User
 
Join Date: May 2007
Location: France
Posts: 52
Configuration

Hello,

I have created several configurations from "01" to "10" for example.
How can I select these configurations one after another (with macro).
I can find the variable to select the configuration.

I would like to create simple animation...

Thanks
Reply With Quote
  #2  
Old 06-15-2010, 10:27 AM
John Scheffel's Avatar
John Scheffel John Scheffel is offline
Administrator
 
Join Date: Sep 2002
Location: San Jose, CA
Posts: 1,288
Re: Configuration

Modeling does have a method for creating Animations but I think you need an Advanced Design license to use it. If you activate the Advanced Assembly module (formerly relations) it will add an icon (looks like a film strip) to your menu to create animations. You don't need to define relations to create the animations, but it can be helpful if simulating mechanisms.

See Help/Help Topics for more info. It is under the Extended Modules section of the Contents.
__________________
John Scheffel
Reply With Quote
  #3  
Old 06-15-2010, 10:43 PM
Maximus172 Maximus172 is offline
Registered User
 
Join Date: May 2007
Location: France
Posts: 52
Re: Configuration

We have a trial version of Advanced Desgin. I didn't find a solution to change the camera view during the animation.
Is it possible ?

I have created (before testing the Advanced module) a animation with several configurations and a free software to record screen activity.

Thanks
Reply With Quote
  #4  
Old 06-16-2010, 12:20 AM
jkramer's Avatar
jkramer jkramer is offline
Registered User
 
Join Date: Oct 2002
Location: the Netherlands
Posts: 382
Re: Configuration

Hi,

nice thought to use configurations for an animation :-)
I just used the recorder tool to find out the commands.
Type this on the commend line to enable the recorder:
(load "recorder")
The recorder will be in the toolbox (hammer / chisel icon).
A configuration is activated by this:
Code:
cfn_activate_double_click_action :add_key :none :config :FULL_NAME :START_NAME "/MAIN_ASSY/SUBASSY" :CONFIGURATION "MY_CONFIG" :END_NAME complete
By simply activating your configurations one-by-one, while the recorder is running, you can play back the animation by saving the recording as a .rec-file, and opening it with OSD (Load > File Type > Recorder (*.rec)).
And in Lisp, you could use this syntax:
Code:
(cfn_activate_double_click_action :add_key :none :config :FULL_NAME :START_NAME "/MAIN_ASSY/SUBASSY" :CONFIGURATION "MY_CONFIG" :END_NAME)
I just recorded and played back one of our assemblies, that has appr. 12 configurations; looks great!
Since you have the options "Capture Drawlist" and "Capture Camera", you can even do real fancy animations with this method :-)
Kind regards,
Jaap
Reply With Quote
  #5  
Old 06-16-2010, 01:00 AM
Maximus172 Maximus172 is offline
Registered User
 
Join Date: May 2007
Location: France
Posts: 52
Re: Configuration

If we have 15 configurations for example and you would like to have animation from the 01 to 10, do you think it's possible to ask the number for the first one and the last one... and run the animation with macro (activate one after another)

I try with variable, but I can find the good solution.
Reply With Quote
  #6  
Old 06-16-2010, 03:56 AM
jkramer's Avatar
jkramer jkramer is offline
Registered User
 
Join Date: Oct 2002
Location: the Netherlands
Posts: 382
Re: Configuration

Hi,

just experimented, but the selection mechanism of OSD sometimes confuses me...
This is what gives me a list:
Code:
(setf my_list (sd-inq-configurations :owner (sd-pathname-to-obj "/MY_ASSY")))
(dolist (obj my_list "done")
(display (eighth(sd-inq-configuration-props obj)))
)
But I couldn't find a smarter syntax that gets rid of the word "eighth"...
And strangely enough, it showed only 11 of the 13 configurations in my assy??!
Anyone a hint??
Regards,
Jaap
Reply With Quote
  #7  
Old 06-16-2010, 06:02 AM
John van Doorn's Avatar
John van Doorn John van Doorn is offline
Registered User
 
Join Date: Nov 2002
Location: The Netherlands
Posts: 83
Re: Configuration

Hi Jaap,Maximus172

I've modified your example in a working lisp file.
Code:
(in-package :xandorra)
(use-package :oli)

(sd-defdialog 'animate_configurations

	:variables '(
		(assembly :value-type :assembly)
	)

	:local-functions '(
		(doit (&aux my_list)
			(setf my_list (sd-inq-configurations :owner assembly))
			(dolist (obj my_list)
				(sd-call-cmds (cfn_activate_configuration :CONFIG obj 
											:ALL_VPS t))
			)
		)
	)
	:ok-action '(doit)
)
__________________
High performance CAD workstations
Please visit us at https://www.cadware.nl
Reply With Quote
  #8  
Old 06-16-2010, 06:54 AM
Maximus172 Maximus172 is offline
Registered User
 
Join Date: May 2007
Location: France
Posts: 52
Re: Configuration

Hi John,

It's a good job, thanks a lot

Except I have one problem. I have added configurations between the others and the animation follow the date creation of the config not the order of the tree

Without that, the macro will be very helpful.
Reply With Quote
  #9  
Old 06-16-2010, 07:57 AM
John van Doorn's Avatar
John van Doorn John van Doorn is offline
Registered User
 
Join Date: Nov 2002
Location: The Netherlands
Posts: 83
Re: Configuration

Hi Maximus172,

You can sort the list my_list before processing

John
__________________
High performance CAD workstations
Please visit us at https://www.cadware.nl
Reply With Quote
  #10  
Old 06-16-2010, 10:26 PM
jkramer's Avatar
jkramer jkramer is offline
Registered User
 
Join Date: Oct 2002
Location: the Netherlands
Posts: 382
Re: Configuration

Hi,

nice macro, John :-)
Maybe a practical solution about the order of configurations would be to have 2 macro's: one that generates a text file with the available configurations, and another that executes the configurations named in the text file. This enables editing of the order before animating.

Regards,
Jaap
Reply With Quote
  #11  
Old 06-17-2010, 04:47 AM
ssusana ssusana is offline
Registered User
 
Join Date: Aug 2004
Location: Italy
Posts: 60
Re: Configuration

Sorry, but sd-inq-obj-pathname no works for configuration. Any idea?
Reply With Quote
  #12  
Old 06-17-2010, 05:16 AM
John van Doorn's Avatar
John van Doorn John van Doorn is offline
Registered User
 
Join Date: Nov 2002
Location: The Netherlands
Posts: 83
Re: Configuration

Here is an example that returns the configuration names as well:

Code:
(in-package :xandorra)
(use-package :oli)

(sd-defdialog 'animate_configurations

	:variables '(
		(assembly :value-type :assembly)
	)

	:local-functions '(
		(doit (&aux my_list)
			(setf my_list (sd-inq-configurations :owner assembly))
			(dolist (obj my_list)
				(sd-call-cmds (cfn_activate_configuration :CONFIG obj 
											:ALL_VPS t))
				(display (getf (sd-inq-configuration-props obj) :name))

			)
		)
	)
	:ok-action '(doit)
)
__________________
High performance CAD workstations
Please visit us at https://www.cadware.nl
Reply With Quote
  #13  
Old 06-17-2010, 05:39 AM
ssusana ssusana is offline
Registered User
 
Join Date: Aug 2004
Location: Italy
Posts: 60
Re: Configuration

thank you!
Reply With Quote
  #14  
Old 06-17-2010, 05:50 AM
John van Doorn's Avatar
John van Doorn John van Doorn is offline
Registered User
 
Join Date: Nov 2002
Location: The Netherlands
Posts: 83
Re: Configuration

Here is an example where the configurations are sorted based on their names:

Code:
(in-package :xandorra)
(use-package :oli)

(sd-defdialog 'animate_configurations

	:variables '(
		(assembly :value-type :assembly)
	)

	:local-functions '(
		(doit (&aux my_list)
			(setf my_list (sort (sd-inq-configurations :owner assembly) #'(lambda (x y)
				(if (string< (getf (sd-inq-configuration-props x) :name) (getf (sd-inq-configuration-props y) :name))
					t
					nil))))
			(dolist (obj my_list)
				(sd-call-cmds (cfn_activate_configuration :CONFIG obj :ALL_VPS t))
			)
		)
	)
	:ok-action '(doit)
)
__________________
High performance CAD workstations
Please visit us at https://www.cadware.nl
Reply With Quote
  #15  
Old 06-18-2010, 11:52 AM
Wolfgang's Avatar
Wolfgang Wolfgang is offline
Registered User
 
Join Date: Nov 2002
Location: ... near Sindelfingen near Stuttgart, Germany
Posts: 754
Re: Configuration

Quote:
Originally Posted by jkramer View Post
But I couldn't find a smarter syntax that gets rid of the word "eighth"...
Yes.. it's so nice to type
Code:
(nth 7 your-list)
I personally prefer (car ..), (cadr..) and when I need more using (nth ...).
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 01:20 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.
You Rated this Thread: