the logic behind the feature manager tree display order

There is something I always wanted to ask, but never dared: Why are there some item's, like sketches inside a loft feature, who are displayed as sub branches of the feature (in a way that gives the graphic idea who is the parent and who is the child). While if you thicken this loft feature, then the thicken feature arranges itself under the loft, and not as a main branch which has a sub branch named loft which has three sketch sub branches (in a way that confuses me and is not coherent graphically with parent\child relations principal)? Is there something wrong in my solidworks settings, or did I miss the point of "parent\child relations" + "feature manager tree" completely?

Reply to
Gil Alsberg
Loading thread data ...

That's the way it is. Sketches always get absorbed, so do curves (projected/ composite, etc), but surface features don't get absorbed. It's pretty inconsistant, I agree. There are some times with sketch relationships on rolled back items where it is difficult to be able to select what you want because of order.

I've often wished for the ability to make the tree completely chronological. I think the only recourse we have is the enhancement request page.

matt

Reply to
matt

I get the following information from a simple loft with thin option. Note that the parent features of the loft in feature 14 are reported in something like parent child order. In other words the first sketch in the selection box is reported, then its immediate parent, the the next sketch in the selection box and its parent. I am thinking that sketch 2 would report all the way up to the front plane if front plane wasn't used by another feature. This list was generated by a macro I wrote that lists all feature information in a part or assembly.

00001============== Name = Annotations [DetailCabinet] Created By = Created Date = 11/3/2003 9:30:02 AM Modified Date = 11/3/2003 9:30:02 AM

00002============== Name = Material [MaterialFolder] Created By = kellnerp Created Date = 6/28/2005 8:53:58 AM Modified Date = 6/28/2005 8:53:58 AM

00003============== Name = Lighting [EnvFolder] Created By = Created Date = 11/3/2003 9:30:02 AM Modified Date = 11/3/2003 9:30:02 AM

00004============== Name = Surface Bodies [SurfaceBodyFolder] Created By = Created Date = 11/3/2003 9:30:02 AM Modified Date = 11/3/2003 9:30:02 AM

00005============== Name = Solid Bodies [SolidBodyFolder] Created By = Created Date = 11/3/2003 9:30:02 AM Modified Date = 11/3/2003 9:30:02 AM

00006============== Name = Front Plane [RefPlane] Created By = Created Date = 11/3/2003 9:30:02 AM Modified Date = 11/3/2003 9:30:02 AM

00007============== Name = Top Plane [RefPlane] Created By = Created Date = 11/3/2003 9:30:02 AM Modified Date = 11/3/2003 9:30:02 AM

00008============== Name = Right Plane [RefPlane] Created By = Created Date = 11/3/2003 9:30:02 AM Modified Date = 11/3/2003 9:30:02 AM

00009============== Name = Origin [OriginProfileFeature] Created By = Created Date = 11/3/2003 9:30:02 AM Modified Date = 11/3/2003 9:30:02 AM Parents: Front Plane [RefPlane]

00010============== Name = swCP3Attribute [Attribute] Created By = kellnerp Created Date = 7/8/2005 7:40:13 AM Modified Date = 7/8/2005 7:40:13 AM

00011============== Name = Plane1 [RefPlane] Created By = kellnerp Created Date = 8/5/2005 1:26:03 PM Modified Date = 8/5/2005 1:26:03 PM Parents: Front Plane [RefPlane]

00012============== Name = Sketch1 [ProfileFeature] Created By = kellnerp Created Date = 8/5/2005 1:26:08 PM Modified Date = 8/5/2005 1:26:08 PM Parents: Front Plane [RefPlane]

00013============== Name = Sketch2 [ProfileFeature] Created By = kellnerp Created Date = 8/5/2005 1:26:29 PM Modified Date = 8/5/2005 1:26:29 PM Parents: Plane1 [RefPlane]

00014============== Name = Loft-Thin1 [Blend] Created By = kellnerp Created Date = 8/5/2005 1:35:04 PM Modified Date = 8/5/2005 1:35:04 PM Parents: Sketch1 [ProfileFeature] Front Plane [RefPlane] Sketch2 [ProfileFeature] Plane1 [RefPlane]

If I re-order the sections I get:

00014============== Name = Loft-Thin1 [Blend] Created By = kellnerp Created Date = 8/5/2005 1:35:04 PM Modified Date = 8/5/2005 1:35:04 PM Parents: Sketch2 [ProfileFeature] Plane1 [RefPlane] Sketch1 [ProfileFeature] Front Plane [RefPlane]
Reply to
TOP

I agree with you Matt - some control in the options menu, on the way in which solidworks arranges features in the feature manager tree, would certainly be nice.

Reply to
Gil Alsberg

Probably has to do with construction and rollback order.

Reply to
Boat

This is a work in progress. It might give you some insight. Since I can't post .swp files you will have to do your best to recreate the form.

In a module paste the following:

Sub main()

Load ListFeatures ListFeatures.Show 0

End Sub

In a form paste the following after creating a form with a Userform called ListFeatures, two command buttons labled CommandButton1 and 2, a label named Label1, a treeview named TreeView1 and a textbox labeled TextBox1. You must have Microsoft TreeView Control 6.0 checked in the tool pallete. Arrange the tools as you see fit but make sure both the text box and treeview can scroll.

' ****************************************************************************** ' C:\DOCUME~1\KELLNERP\LOCALS~1\Temp\swx332\Macro1.swb - macro recorded on 07/13/05 by kellnerp ' ****************************************************************************** Dim swApp As Object Dim Part As Object Dim boolstatus As Boolean Dim longstatus As Long, longwarnings As Long Dim FeatureData As Object Dim Feature As Object Dim Component As Object Dim swFeat, swChildFeat As SldWorks.Feature Dim vChildArr As Variant Dim FeatNum As Long

Private Sub CommandButton1_Click()

Set swApp = Application.SldWorks

Set Part = swApp.ActiveDoc

Label1.Caption = Part.GetPathName

Set Feature = Part.FirstFeature

TreeView1.Nodes.Clear

FeatNum = 1 Do While Not Feature Is Nothing Fname = Feature.Name TreeView1.Nodes.Add , , Fname, Fname 'TreeView1.Nodes.Add Feature.Name, tvwChild, Feature.Name, Feature.Name 'TreeView1.Nodes.Add "root", tvwChild, "child2_root", "Child2 of Root" 'TreeView1.Nodes.Add "child1_root", tvwChild, "child1_child1", "Child1 of Child1"

TextBox1.Text = TextBox1.Text & Chr(13) & Format(FeatNum, "00000") & "==============" & Chr(13) TextBox1.Text = TextBox1.Text & "Name = " & Feature.Name & " [" & Feature.GetTypeName & "]" & Chr(13) TextBox1.Text = TextBox1.Text & "Created By = " & Feature.CreatedBy & Chr(13) TextBox1.Text = TextBox1.Text & "Created Date = " & Feature.DateCreated & Chr(13) TextBox1.Text = TextBox1.Text & "Modified Date = " & Feature.DateModified & Chr(13)

vChildArr = Feature.GetParents If Not IsEmpty(vChildArr) Then

TextBox1.Text = TextBox1.Text & " Parents:"

For Each vChild In vChildArr

Set swChildFeat = vChild

TextBox1.Text = TextBox1.Text & " " + swChildFeat.Name

  • " [" + swChildFeat.GetTypeName + "]" & Chr(13)

Next vChild Set swChildFeat = vChildArr(0) Cname = swChildFeat.Name TreeView1.Nodes.Remove (Fname)

Debug.Print TreeView1.Nodes.Item(Cname) TreeView1.Nodes.Add Cname, tvwChild, Fname, Fname ''TreeView1.Nodes.Add Fname, tvwChild, , swChildFeat.Name

'Debug.Print TreeView1.Nodes.Item(Fname) End If

TreeView1.Nodes(TreeView1.Nodes.Count).EnsureVisible

Set Feature = Feature.GetNextFeature() FeatNum = FeatNum + 1 Loop

End Sub

Private Sub CommandButton2_Click() End End Sub

Private Sub UserForm_Click()

End Sub

Reply to
TOP

sorry TOP, but I'm unfamiliar with modules, macros and API stuff in solidworks although I plan one day to learn them. Thanks for your effort in trying to help me understand though!

Reply to
Gil Alsberg

If you really think about it, the thicken should not be absorbed. The thicken is not the parent of the loft, rather its the child. It did not take the thicken to create the loft rather vice versa.

If you are asking for the loft to be absorbed into the thicken, even that is not such a good idea if only because that would begin to produce an hierarchy that you wouldnt want. Take for example that you create the profiles, and guide curves, do the loft, and then the throw the thicken on top of that. Imagine you surpress the thicken with the loft absorbed, then everything else goes with it.

the way it is now, it is an independant feature unto itself, only parented by the loft, which is parented by the sketches.

Hope this helps

Reply to
modelsin3d

Gil,

If you want something interesting to analyze run the STAR benchmark and then look at the resulting part with the ReadFeatInfo macro. Be patient and scroll down the feature list. It will look boring until all of a sudden you will see a feature with a bunch of parents. Take a mental note on the parents and keep scrolling. You will find that the last feature is the child of all the other features IIRC. If you had to graph what you saw, how would it look? It isn't a simple tree structure as I have depicted it in the right hand pane.

I might come to the conclusion that it is handy to classify parents as Class I and Class II. A Class I parent is the explicit feature or features that generates the feature under review. A Class II parent implicitly defines the feature under review. For example, in the STAR part a plane and sketch define each cube. However, some cubes also have other cubes as Class II parents because those parents are used in trimming back the feature. Now where it gets interesting is that it is not apparent that the fact that a Class II parent is in fact trimmed by its child making them mutual parents. The fact of the matter is that the child can change and alter the parent.

I would like to be able to differentiate whether parents are Class I or Class II in the macro. That will take some head scratching.

Reply to
TOP

TOP,

what you describe is very interesting and somehow weird. I would like to see it with my own eyes though - from where do I download the STAR benchmark (can you post a link)?

Reply to
Gil Alsberg

That's exactly what i meant. and how i expect SW to arange and display the features.

On this i didn't thought, and you are making here a good point! although i think with a lot of programing from SW, that can be solved either, in a way that one can supress only child features inside a hirarchy tree.

it does, thanks

Reply to
Gil Alsberg

It has been posted a few times but here it is again.

formatting link

Reply to
TOP

thanks

Reply to
Gil Alsberg

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.