for toolbars, vla-get-floatingrows always returns 1

for toolbars, vla-get-floatingrows always returns 1

Anonymous
Not applicable
748 Views
2 Replies
Message 1 of 3

for toolbars, vla-get-floatingrows always returns 1

Anonymous
Not applicable

I'm building a lisp routine to save and restore toolbar positions.  This is helpful for switching between my office computer with two screens and my remote (home) computer using one screen.

 

The initial problem I am having is that vla-get-floatingrows seems to always return 1 instead of the number of rows showing in the toolbar.

 

(defun GetToolbarPositions (/ rtlist)
	(vlax-for	mgp	(vla-get-menugroups (vlax-get-acad-object))
		(vlax-for	tb (vla-get-toolbars mgp)
			(if	(= :vlax-true (vla-get-visible tb))
				(setq
					rtlist (cons
									 (list
										 (cons 'Mgroup (vla-get-name mgp))
										 (cons 'toolbar (vla-get-name tb))
										 (cons 'top (vla-get-top tb))
										 (cons 'left (vla-get-left tb))
										 (cons 'DockStatus (vla-get-DockStatus tb))
										 (cons 'FloatingRows (vla-get-FloatingRows tb))
									 )
									 rtlist
								 )
				)
			)
		)
	)
	rtlist
)

Is anyone else seeing this behavior?

 

Mike

0 Likes
Accepted solutions (1)
749 Views
2 Replies
Replies (2)
Message 2 of 3

CodeDing
Advisor
Advisor
Accepted solution

@Anonymous ,

 

I understand where you're coming from. When you adjust a floating toolbar, the number of rows changes and you want to identify that..

So, I tried that with your tool and was reading 1 floating row also.

Next, I experimented with SETTING the # of Floating Rows. And after setting the number, it was reading more than one.

 

But, just because the toolbar is ABLE to be adjusted to multiple rows (dynamically), does not mean that it DEFAULTS to multiple rows..

If we look in our CUI at our Toolbar, we can see the property that is being referenced for the toolbar here:

image.png

 

And since this property is a DEFAULT property, and not a DYNAMIC one.. I believe that is the number that is being displayed to you.

 

If someone could prove otherwise, I would appreciate the insight. But this is what I believe is happening here.

Hope it helps.

 

Best,

~DD

0 Likes
Message 3 of 3

Anonymous
Not applicable

@CodeDing 

Over at theswamp, framednlv found that after closing and restarting Acad the FloatingRows property reported the correct value...until a change was made.  It's just about as if the property is read for each toolbar when they are initially placed on the screen, but not after that.

 

I tried to find a way to calculate the number of floating rows from the width and height properties, but couldn't see a reliable way.

 

Thanks for taking a look at it.

 

Mike