Hole Callouts via VBA?
Hole Callouts via VBA?
(OP)
The Hole Callout feature isn't as flexible as I need it to be. For example, the number of hole instances is shown as "#X" and is always at the beginning of the note. I instead need "# PLACES" at the end of the note.
Also, I need to be able to select from a variety of different notes for a particular hole type. For example, a plain thru hole could get any one of the following notes:
(DIA) DRILL THRU
3 PLACES
(DIA) DRILL THRU & INSERT 1/4-20 PROPELL NUT
ON BACK, 3 PLACES
(DIA) DRILL THRU & INSERT DOWEL PIN
3 PLACES
As it is right now, the Hole Callout feature will not allow you to select from a 'library' of hole notes--it uses the one and only callout that is set up in the calloutformat.txt file.
However, while placing a hole callout, you can choose the "More Properties... Modify Text" function and pretty much edit to your heart's content.
That got me to thinking--could a macro be written that would:
-start the hole callout command
-allow the user to select a hole
-pop up a custom form to allow the user to choose from a list of hole callouts (my custom list)
-populate the hole callout "Modify Text" box with the note chosen in the previous step (either visibly or invisibly)
Any thoughts--can it be done? Hopefully it can. I have a very basic knowledge of VBA, and I'll take a shot at writing something. If anybody has any tips, or could even get me started on the right track, that would be very helpful and extremely appreciated. I'm looking forward to your responses. Thanks,
Brian
Also, I need to be able to select from a variety of different notes for a particular hole type. For example, a plain thru hole could get any one of the following notes:
(DIA) DRILL THRU
3 PLACES
(DIA) DRILL THRU & INSERT 1/4-20 PROPELL NUT
ON BACK, 3 PLACES
(DIA) DRILL THRU & INSERT DOWEL PIN
3 PLACES
As it is right now, the Hole Callout feature will not allow you to select from a 'library' of hole notes--it uses the one and only callout that is set up in the calloutformat.txt file.
However, while placing a hole callout, you can choose the "More Properties... Modify Text" function and pretty much edit to your heart's content.
That got me to thinking--could a macro be written that would:
-start the hole callout command
-allow the user to select a hole
-pop up a custom form to allow the user to choose from a list of hole callouts (my custom list)
-populate the hole callout "Modify Text" box with the note chosen in the previous step (either visibly or invisibly)
Any thoughts--can it be done? Hopefully it can. I have a very basic knowledge of VBA, and I'll take a shot at writing something. If anybody has any tips, or could even get me started on the right track, that would be very helpful and extremely appreciated. I'm looking forward to your responses. Thanks,
Brian






RE: Hole Callouts via VBA?
RE: Hole Callouts via VBA?
As long as I know that it can be done, I'll keep you posted on the progress. Thanks,
Brian
RE: Hole Callouts via VBA?
I agree, this will be a helpful macro.
Chris
Sr. Mechanical Designer, CAD
SolidWorks 2005 SP0.1
RE: Hole Callouts via VBA?
Brian
RE: Hole Callouts via VBA?
If anyone create a macro, I'm interested in trying it.
thanks
Chris
Sr. Mechanical Designer, CAD
SolidWorks 2005 SP0.1
RE: Hole Callouts via VBA?
There may be a problem using the api interface with hole callouts. Using DisplayDimension.SetText() to add a dimension prefix or suffix works fine for standard dimensions. but it does not seem to also work for hole callouts. The dimension textbox expands after the macro is run to add the extra text - when you click and drag the dimension the box which surrounds it is wider than before the routine was run. This suggests that the text was successfully added, but the extra text is not displayed. There does not seem to be a separate function to modify the text in existing hole callouts through the api.
RE: Hole Callouts via VBA?
Just my 2 cents.
Alex