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: 

How to get all the feature information?

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
149933512
250 Views, 3 Replies

How to get all the feature information?

hi,
Use c#.
How to get all the features, traverse all the features and get the information of each feature, such as vector, type, hole diameter and so on.

3 REPLIES 3
Message 2 of 4
ondrej.mikulec
in reply to: 149933512

To get all Featuresets parameters you can use:

print par "folder('Featureset')"

If an entity type have its components which in case of Featuresets are Features, then the command components() will return those. This example returning all parameters from the Featureset in the index 0 from folder('Featureset') command.

print par "components(folder('Featureset')[0])"

You can access particular parameter for example the diameter from the Feature in the index 0.

print par "components(folder('Featureset')[0])[0].Diameter"

The clean return working only when the returned object can be represented by string.

print par terse "components(folder('Featureset')[0])[0].Diameter"

 Another way is just use standard macros. Your app can contain prewritten macros files that contains foreach loop and print commands. Calling those macros will return desired parameters. This approach is surprisingly faster.

FOREACH $ft IN folder('Featureset') {
	FOREACH $feat IN components($ft) {
		PRINT ${$ft.Name + "|" + $feat.Name + "|" + $feat.Diameter + "|" + $feat.WPPoint.X + "|" + $feat.WPPoint.Y + "|" + $feat.WPPoint.Z}
	}
}
Message 3 of 4

Actually, another option is to use to_xml() command.

print par "to_xml(components(folder('Featureset')[0]))"
Message 4 of 4
149933512
in reply to: ondrej.mikulec

Thank you very much

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

Post to forums  

Technology Administrators