Community
PowerShape Forum
Welcome to Autodesk’s PowerShape Forums. Share your knowledge, ask questions, and explore popular PowerShape topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

naming solids with macro

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
a1moldmaker
1493 Views, 4 Replies

naming solids with macro

is there a way using a macro to name a solid and if that name is used it will add a _next number

 

from a macro  if i create a solid block, name it base

them make another solid and name it base it would add _1 to second block

 

 

Bruce Green
Saying I cant always leads to failure
Saying I tried MIGHT lead to success
4 REPLIES 4
Message 2 of 5
jon.hunwick
in reply to: a1moldmaker

That should be fairly easy, Bruce. In broad brush strokes (you will find the actual commands to use in the Help) what you'll need to do is this:

 

1 - Ask the user for a text string of the root name.

2 - Store the name of the currently selected solid

3 - Create a next text string that is the toot name + '_' + a number (starting at 1) 

(The command you need here is 'concatenate' e.g. let newname = concatenate ($rootname ; '_' ; $counter)

4 - Find out if that solid exists.

5 - If it does not, rename the current solid

6 - If it exists, increment the counter by one, and go back to step 3

 

 

Jon Hunwick

Message 3 of 5
camgank
in reply to: jon.hunwick

can you give me the example please

~try and pray~
Cadcam programmer
Mold designer
Message 4 of 5
mwsiviero
in reply to: jon.hunwick

Does anybody have an example, please?
Message 5 of 5
mwsiviero
in reply to: jon.hunwick

Does anybody have an example, please? Thanks.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report