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

[macro] pattern check

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
moraschini
294 Views, 4 Replies

[macro] pattern check

hello everyone, is possible check if 2 pattern are equal or not?

moraschini_0-1716877330641.png

 

i have this 2 line on different level trnsfered from cad and i need to check if these are the same or not.
thanks in advance for the help

 

4 REPLIES 4
Message 2 of 5
icse
in reply to: moraschini

you can try somehting like this:

 

entity $lvl1 = input entity level 'Select first'
entity $lvl2 = input entity level 'Select second'


EDIT MODEL ALL DESELECT ALL

EDIT LEVEL ${lvl1.Name} SELECT WIREFRAME
EDIT LEVEL ${lvl2.Name} SELECT WIREFRAME

string $p = new_entity_name('pattern')
CREATE PATTERN ;
EDIT PATTERN ${p} INSERT MODEL

EDIT PATTERN ${p} DESELECT ALL
EDIT PATTERN ${p} SELECT DUPLICATES


if number_selected('pattern', $p) != 0 {
	message info 'Equal'
} else {
	message info 'Not Equal'
}

purge pattern ${p} yes

 

I did not tested this properly, there might be some edge cases...

Message 3 of 5
moraschini
in reply to: icse

hello @icse , is there a way to select only a colour of the level instead of all the level?

thanks in advance

 

Message 4 of 5
icse
in reply to: moraschini

you can use this command to filter:

EDIT SELECTION MODEL FILTER '255, 128, 0'

 

entity $lvl1 = input entity level 'Select first'
entity $lvl2 = input entity level 'Select second'


EDIT MODEL ALL DESELECT ALL

EDIT LEVEL ${lvl1.Name} SELECT WIREFRAME
EDIT LEVEL ${lvl2.Name} SELECT WIREFRAME

//your color
EDIT SELECTION MODEL FILTER '255, 128, 26'

string $p = new_entity_name('pattern')
CREATE PATTERN ;
EDIT PATTERN ${p} INSERT MODEL

EDIT PATTERN ${p} DESELECT ALL
EDIT PATTERN ${p} SELECT DUPLICATES


if number_selected('pattern', $p) != 0 {
	message info 'Equal'
} else {
	message info 'Not Equal'
}

purge pattern ${p} yes
Message 5 of 5
moraschini
in reply to: icse

Thank you very much @icse,

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report