.NET

Reply
New Member
Ronald22
Posts: 1
Registered: ‎08-23-2006
Message 1 of 2 (260 Views)

Edit properties of ToolPallete ( CatalogItem )

260 Views, 1 Replies
08-23-2006 07:48 AM
I’m kinda new to AutoCad programming and hope I ask the question right :smileyhappy: I atleast couldn’t find another post about this.

Is there a way I can access the properties of a CatalogItem in an existing tool palette?


With the code below I managed to loop through the existing items in the loaded tool palettes.


_
Public Sub Test()
'Initiate ToolPaletteManager
Dim tp As ToolPaletteManager = Autodesk.AutoCAD.Windows.ToolPalette.ToolPaletteManager.Manager

'Initiate the CatalogItems from the toolpalette.
Dim catalogItemCol As CatalogItemCollection = tp.Catalogs
Dim iter As Long

'Iterate through all items in the toolpalette catalog
For iter = 0 To catalogItemCol.Count - 1

Dim catalogMain As CatalogItem
catalogMain = catalogItemCol.Item(iter)

'iterate through all tool palette tabs
Dim iter2 As Long
For iter2 = 0 To catalogMain.ChildCount - 1

Dim catalogSub As CatalogItem
catalogSub = catalogMain.GetChild(iter2)

'Iterate through all items in the palette tab
Dim iter3 As Long
For iter3 = 0 To catalogSub.ChildCount - 1
Dim palItem As CatalogItem
palItem = catalogSub.GetChild(iter3)

'todo
'get the properties of the catalogItem (palItem)

'edit items if needed

Next
Next
Next

End Sub


I found the CustomBaseClass which contains the function .GetToolProperties(), but I have no idea how to use it. If anyone could point me out to the right direction I would really appreciate it.

If you have a better way to access the toolpalette items using VB.Net or C# I would really like to know. I’ve checked the sample SimpleToolPalette, but I can’t make anything out of it, besides creating new Tool palette’s

Many thanks in advance !
Contributor
nikgl
Posts: 13
Registered: ‎06-16-2005
Message 2 of 2 (260 Views)

Re: Edit properties of ToolPallete ( CatalogItem )

06-11-2007 03:55 AM in reply to: Ronald22
It's old but did anyone found a solution?
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.