Reply

Object highlight

[ Edited ]

Hi,

 

How can i highlighting a occurrence, finding it by the occurrence name...

 

Aldo.

 

Posted by: Aldo Kruger
Post date: 11/8/2005 2:30:08 AM

11 REPLIES

RE: Object highlight

[ Edited ]

Aldo,

 

This is usually accomplished by using the SelectSet.Add() method. I have not tried it with occurrences.

 

Try something like objAssembly.SelectSet.Add(...)

 

 

You can also use Solid Edge Find to see if my theory is correct. Open an assembly, select the occurrence and check in Solid Edge Find if the Application.ActiveDocument.SelectSet has data.

 

Let me know if you still need help and I'll try to code an example for you.

 

Posted by: Jason Newell
Post date: 11/8/2005 2:33:56 AM

RE: Object highlight

[ Edited ]

Hello Aldo

 

I 'cut&paste'd this out of a project of mine.

 

Private HighLight As SolidEdgeFramework.HighlightSet

Private objapp As SolidEdgeFramework.Application

Private objdoc As solidedgepart.PartDocument

Private highsets As HighlightSets

Set objapp = GetObject(, "SolidEdge.Application")

Set objdoc = objapp.ActiveDocument

Set highsets = objdoc.HighlightSets

Set HighLight = highsets.Add

'Aldo, in between thes lines, get the object you need wich i called YourObject

HighLight.AddItem yourObject

HighLight.Color = vbYellow

HighLight.Draw

'now your object should be highlighted in the color yellow

HighLight.RemoveItem (HighLight.Count) 'remove the last added object from your highlightset

HighLight.Draw

'set everything to nothing

Set Highlight=Nothing

Set Highsets=Nothing

Set objdoc=Nothing

Set objapp =nothing

 

 

If you step trough thisone, it should help you to understand the highlightset.

A highlightset is a different thinh then a selectionset.

It is also possible to create different highlightsets, each with a different color, all in the same view, so you can, for instance, highlight edges in yellow, faces in cyan, keypoints in green,...

 

good luck!

Kris.

 

Posted by: Kris Verheyen
Post date: 11/8/2005 7:45:32 AM

RE: Object highlight

[ Edited ]

 

Tanks for all...

 

I make this,

 

Dim objHighlightSets As SolidEdgeFramework.HighlightSets

Dim objHighlightSet As SolidEdgeFramework.HighlightSet

Dim Occ As SolidEdgeAssembly.Occurrence

Dim i As Integer

Try

pg.SelectedObject = oDocs(tvw.SelectedNodes(0).Tag)

'Dim objDoc As SolidEdgeAssembly.AssemblyDocument

Dim objDoc As Object

Try

objDoc = p_application.ActiveDocument

 

If Not objDoc Is Nothing Then

Dim wind As SolidEdgeFramework.Window

 

objHighlightSets = objDoc.HighlightSets

'clear the HighlightSets object

For i = 1 To objHighlightSets.Count

objHighlightSets.Item(i).RemoveAll()

Next

 

wind = objDoc.Windows.Item(1)

wind.View.Update() 'redraw the window

 

'create a new HighlightSet object

objHighlightSet = objHighlightSets.Add()

For Each Occ In objDoc.Occurrences

'if the occurrence name equal as the tree selected object

If tvw.SelectedNodes(0).Text = Occ.OccurrenceDocument.Name Then

'add's it to the HighlightSet

objHighlightSet.AddItem(Occ)

End If

Next

'draw the HighlightSet object

objHighlightSet.Draw()

End If

Catch ex As Exception

MessageBox.Show(ex.Message)

End Try

Catch

End Try

 

 

And it's works with Occurrences objects.

 

 

 

Posted by: Aldo Kruger
Post date: 11/8/2005 10:27:24 AM

RE: Object highlight

[ Edited ]

Looks like someone has a custom Addin .

 

Where did you find that TreeListView control?

 

Posted by: Jason Newell
Post date: 11/8/2005 10:34:52 AM

RE: Object highlight

[ Edited ]

TreeListView Control

http://www.codeproject.com/cs/miscctrl/extendedlistviews.asp

 

Posted by: Aldo Kruger
Post date: 11/8/2005 10:42:59 AM

RE: Object highlight

[ Edited ]

Jason,

 

I have a problem using a imagelist in the treelistview, after using the releasebuild utility, the edgebar not display after releasebuild.

 

Please can you help me - where is my problem.

 

Thank you...

 

Aldo.

 

Posted by: Aldo Kruger
Post date: 11/8/2005 10:48:17 AM

RE: Object highlight

[ Edited ]

Nice, thanks for the url. It's funny because I frequent that site often and have never seen that particular article. Nice find.

 

Posted by: Jason Newell
Post date: 11/8/2005 10:48:23 AM

RE: Object highlight

[ Edited ]

Aldo,

 

You'll have to modify the ReleaseBuild.bat. Look at the following example. I've bolded the lines you need to look at. Obviously, change the names to match yours.

 

The thing that you're looking for are .resx files in your project folder. Anytime you add graphics to a control, they get stored in the .resx which means the build is slightly different.

 

Let me know if you still have trouble. We'll get you going because I'm familiar with this one.

 

 

ECHO OFF

CLS

 

SETLOCAL

PUSHD %VS71COMNTOOLS%

@call vsvars32.bat

POPD

 

resgen About.resx SEAddin3.About.resources

 

SET CSCARGS=

SET CSCARGS=%CSCARGS% /win32res:Addin.res

SET CSCARGS=%CSCARGS% /resourceSmiley FrustratedEAddin3.About.resources

SET CSCARGS=%CSCARGS% /target:library

SET CSCARGS=%CSCARGS% /out:./bin/Release/SEAddin3.dll

SET CSCARGS=%CSCARGS% /reference:

SET CSCARGS=%CSCARGS%./bin/Release/Interop.SolidEdgeFramework.dll;

SET CSCARGS=%CSCARGS%./bin/Release/Interop.SolidEdgeConstants.dll;

SET CSCARGS=%CSCARGS% *.CS

 

CSC %CSCARGS%

 

regasm /nologo /silent /codebase ./bin/Release/SEAddin3.dll

ENDLOCAL

 

ECHO Compile Complete

pause

 

Posted by: Jason Newell
Post date: 11/8/2005 10:55:20 AM

RE: Object highlight

[ Edited ]

Hi Guys,

 

a bit off topic...

 

I'd stumbled accros the TreeListView article before (nice control), but what I'd like to know is where you got the VS.Net style properties ListView (under the TreeListView in the screenshot)?

 

Calum

 

Posted by: Calum McLellan
Post date: 11/9/2005 5:50:10 AM