tigger29900 Posted December 5, 2011 Posted December 5, 2011 Newbie here i have been using this forum frequently as of late and had a question i was hoping you could help me with. I am building a program in visual basic to select certain layers and change their color to outline a certain path on a layer diagram. I need to program a clear button that sets all of the layer colors back to color 7 as efficiently as possible any help would be appreciated Secondly and less important I was trying to figure out a way to select all of the text in the selected layers and export them to excel to build an effected equipment list. )I'm not sure if this is even possible) Any help would be greatly appreciated Quote
BlackBox Posted December 5, 2011 Posted December 5, 2011 Welcome to CADTutor! You may find posting questions like this answered more quickly, appropriately, when posted in one of the programming forums found here. Also be sure to use [/url] when posting code. Perhaps a moderator can move this? [quote name='tigger29900'] I am building a program in visual basic to select certain layers and change their color to outline a certain path on a layer diagram. I need to program a clear button that sets all of the layer colors back to color 7 as efficiently as possible[/quote] I'd personally recommend that you use Visual LISP, or VB.NET in lieu of VBA, just because there's a lot more support (i.e., sample code, tutorials, documentation, etc.) to help you learn. In any event, use the ClearButton_Click Event to iterate through the Layers Collection, and change the Color Property. Visual LISP example: [code] (defun c:FOO () (vl-load-com) ((lambda (acDoc / oLayer) (vlax-for oLayer (vla-get-layers acDoc) (if (/= acWhite (vla-get-color oLayer)) (vla-put-color oLayer acWhite)))) (vla-get-activedocument (vlax-get-acad-object))) (princ)) Secondly and less important I was trying to figure out a way to select all of the text in the selected layers and export them to excel to build an effected equipment list. )I'm not sure if this is even possible) Yes, this is possible. Give the programming forums a search, as I am sure this has been discussed before. Hope this helps (HTH). Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.