CoCreate User Forum  

Go Back   CoCreate User Forum > Support > Customization
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 09-11-2003, 05:05 AM
MikeBoswell MikeBoswell is offline
CAD Sys Adm
 
Join Date: Feb 2003
Location: Andover, MA
Posts: 99
Lisp Code

I am trying to make a dialog that will facilitate making the Contents ID the same as the part name.

The below code works, but needs refinement.

Would someone help me w/:

How do I execute the "(sd-call-cmds (change_pa_id a-part new-name)" w/ my 'Next' button and keep the dialog up?

I have never written LISP before, so any other suggestions are welcomed.

Thanks,

(in-package :vicor)
(use-package :OLI)


(sd-defdialog 'Change_CID
:variables
'((A-PART :title "Part"
:value-type :part-incl-new
:after-input (setq new-name (sd-inq-obj-basename a-part)))
(NEW-NAME :title "New CID"
:value-type :string
:initial-value (sd-inq-obj-basename a-part))
(NEXT :toggle-type :grouped-toggle
:title "Next"
:push-action (display "do IT again")))

:ok-action
'(sd-call-cmds (change_pa_id a-part new-name)))
Attached Files
File Type: lsp lisp.lsp (533 Bytes, 327 views)
Reply With Quote
  #2  
Old 09-19-2003, 04:02 AM
Wolfgang's Avatar
Wolfgang Wolfgang is offline
Registered User
 
Join Date: Nov 2002
Location: ... near Sindelfingen near Stuttgart, Germany
Posts: 754
Hi, I put the main action into a local function, which is called when pressing NEXT and OK. I only *wrote* it. It's not tested!
Attached Files
File Type: txt change_cid.lsp.txt (815 Bytes, 364 views)

Last edited by Wolfgang; 09-19-2003 at 04:05 AM.
Reply With Quote
  #3  
Old 09-19-2003, 04:43 AM
MikeBoswell MikeBoswell is offline
CAD Sys Adm
 
Join Date: Feb 2003
Location: Andover, MA
Posts: 99


Thanks Wolfgang!

This works great.

Anyone interested in making this thing loop thru all of the parts in an assembly????


MikeB
VIcor corp
Andover, MA
USA
Reply With Quote
  #4  
Old 09-22-2003, 05:43 AM
MikeBoswell MikeBoswell is offline
CAD Sys Adm
 
Join Date: Feb 2003
Location: Andover, MA
Posts: 99
I have modified it further and made it do a list of renames from a selection recursively top down.

I stole 90% of the code from this forum.

The problem w/ it now is it won't handle a list of 1. I cannot select a single part.

Also, no error checking.

Anyone????
Attached Files
File Type: lsp change_cid.lsp (799 Bytes, 329 views)
Reply With Quote
  #5  
Old 09-23-2003, 01:18 PM
Wolfgang's Avatar
Wolfgang Wolfgang is offline
Registered User
 
Join Date: Nov 2002
Location: ... near Sindelfingen near Stuttgart, Germany
Posts: 754
Hi Mike,

use:

:value-type :part-incl-new
:multiple-items t

and then a dolist as you did.

use the normal UI for selection then..
instead of first select an assembly and then doing a second selection of the parts itself.

If you have selected a single part your (get_selection ... :in_assembly a-part) is empty.. therefore nothing happens.
Reply With Quote
  #6  
Old 09-23-2003, 01:22 PM
Wolfgang's Avatar
Wolfgang Wolfgang is offline
Registered User
 
Join Date: Nov 2002
Location: ... near Sindelfingen near Stuttgart, Germany
Posts: 754
(some-parts
:value-type :part
:multiple-items t
:modifies :contents
..
)

would help to avoid select read-only parts
Reply With Quote
  #7  
Old 09-24-2003, 06:13 AM
MikeBoswell MikeBoswell is offline
CAD Sys Adm
 
Join Date: Feb 2003
Location: Andover, MA
Posts: 99
Wolfgang,

Thanks for looking at this again !

When I try to implement your suggestions I get an error when I OK the dialog.

"input contains element of wront type"

I get this erro w/ a single part or a list.

Prior to these last changes the script would allow me to select an assy (push the dialog part button and double click the assy in the struct browser) and it would put the parts of the assy into a list and modify each.

The proplem there was I could not only select a single part or select a list of parts, it needed to be an assy.

I would like to be able to pick an assy or make a list of parts or pick 1 part.

Is that possible? Is that what you have suggested? Am I confused? probably yes to all of these.

Thanks,

Mikeb
Reply With Quote
  #8  
Old 10-08-2003, 10:26 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
Modified Lisp code

Hi,

I've changed it again, it now allows you to select an assembly or a single part.
Also when a part is read-only it is being skipped.

Goodluck with it
Attached Files
File Type: lsp change_cid.lsp (948 Bytes, 302 views)
Reply With Quote
  #9  
Old 10-08-2003, 10:33 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
Talking

Hi,

When uploading the my first change to your lisp file. I start reading what you wrote. I should have done that first :-)

So, I forgot to build in that you would like to select multiple assemblies and/or parts. So the attached lisp file is now taking care of this.

Goodluck again.

John
Attached Files
File Type: lsp change_cid.lsp (1.0 KB, 348 views)
Reply With Quote
  #10  
Old 10-09-2003, 04:33 AM
MikeBoswell MikeBoswell is offline
CAD Sys Adm
 
Join Date: Feb 2003
Location: Andover, MA
Posts: 99
Thanks John,

I'll give it a try.
Reply With Quote
  #11  
Old 10-09-2003, 05:38 AM
MikeBoswell MikeBoswell is offline
CAD Sys Adm
 
Join Date: Feb 2003
Location: Andover, MA
Posts: 99
YUP thats it.

Thanks Wolfgang / John.

That was a lot of help.

Mike Boswell
Vicor Corp
Andover MA

ps
John do you remember doing some consult here?
~4 yrs ago, BIG snow storm?
Reply With Quote
  #12  
Old 10-09-2003, 05:55 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
Hi Mike,

How could I forget?
No power for more than a day, dark cold and candles in the Hotel.

This was one of the trips a tell about at parties ;-)

Any way, I hope the lisp file is of any use for you and if you need more help just drop me an email.


Cheers,
John
Reply With Quote
Reply


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

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:25 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.