Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
Currently using the below Java code I am getting many more edges compared to searching for edges in the GUI (ctrl+f, look for:edge)
Where are all the extra edges coming from?
Session currSession= pfcSession.GetCurrentSessionWithCompatibility (CreoCompatibility.C4Compatible);
Model currModel = currSession.GetCurrentModel();
Solid currSolid = (Solid)currModel;
ModelItems edgeItems = currSolid.ListItems(ModelItemType.ITEM_EDGE);
int edgeItemsNum = edgeItems.getarraysize();
Solved! Go to Solution.
For free Java you can try this:
1. List all features.
2. GetIsVisible ()
3. Check a feature type (for example, to exclude not solid surfaces)
4. List sub items for the feature ListSubItems()
Are you listing items in asm or prt ? .. you can insert selected items to buffer to see in gui what edges are selected. If nothing help you can use macro to select edges through ctrl+f and then fire another macro (your command) to do the job.
it is in prt
ProGeomitemIsInactive(...) will filter out inactive edges.
But, IsInactive() method belongs to FeatureStatus object, which is in paid version of jlink, so you will have to do some workaround
Yes, I am using only Java Free
The workaround I currently have is to test each edge to check for two connected surfaces, though this seems to make my code run quite slow given the number of edges to check
While this works to an extend, there is still some differences, for example for one of my models:
(1) ctrl+f = 9069 edges
(2) above code = 31,587 edges
(3) above code + test for connected surfaces = 9011
I am hoping to find a more efficient way to do this
For free Java you can try this:
1. List all features.
2. GetIsVisible ()
3. Check a feature type (for example, to exclude not solid surfaces)
4. List sub items for the feature ListSubItems()