Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with VB Macro code 2

Status
Not open for further replies.

Tobin1

Petroleum
Nov 9, 2007
176
Howdy!

I’m just beginning to learn a bit about the SW API. In the past I used AutoLISP in AutoCAD for productivity enhancements. But I didn’t get into VB at the time. I’ve been using SW daily for a little over a year now. I downloaded a few nice SW Macro’s and recorded a couple of my own.

I’ve found a Macro (AddViewLabel) that is very close to something that would help me label views the way I need to more efficiently. AddViewLabel is a collaborative effort by Matthew Lorono and Regg. I contacted Mr. Lorono to discuss an addition to the code. He’s agreeable with trying to add something to the code.

I need to change the view label’s because, as I’m sure you are all aware, SW uses only one text size for both lines of the view label it produces. I need the last line (the scale) to be a smaller text size than the other lines.

I’d like to change the AddViewLabel's code so it will do the following:
1) Use the SW “Section View Text” text size setting for the first two lines the Macro creates (Firster and Seconder).
Currently the Macro uses the SW “Note” text size setting for all text size:
[get note annotation object]
[Set swAnnotation = swNote.GetAnnotation]
2) Use the SW “Note” text size setting for the third line the Macro creates (showme).
The Macro is currently set up to use this text size for all text.

As I said I’m a beginner at this. I can look thru the code and figure out some of what is going on but not enough to figure out how to add the above function.

Can anybody help me with this?


 
Replies continue below

Recommended for you

fcsuper

Great I'd like your input on the balloon project :) .

Actually at this very moment (and since Monday evening) I haven't been able to work on anything in SW. It seems as though our IT people (yes they actually are people) have updated some Anti-Virus software that causes problems with SW. I've been in contact with our VAR and our IT people but it's not resolved yet.

I'll have to let you know when I make some progress on View Label.

What are your thoughts on the balloon? Do you know of any examples that might be helpful to look at?


Tobin
Tobin.Sparks@nov.com
 
I was thinking a form could be used with radio buttons around a circle. The radio buttons would represent the position you wish the added text to appear in relation to the balloon. You can also edit the value of the balloon itself by pulling in the properties for it as well.

Then group these upon creation/or edit update. It's prolly a bit complex, but I imagine its do-able.

Matt Lorono
CAD Engineer/ECN Analyst
Silicon Valley, CA
Lorono's SolidWorks Resources
Co-moderator of Solidworks Yahoo! Group
and Mechnical.Engineering Yahoo! Group
 
fcsuper

"radio buttons around a circle" I like it.
Do you think I could:
1) start with a default SW single balloon command with a leader then after allowing the two picks needed for that
2) add pre-entered text at a pre-selected position
3) then group it before the Macro ends?
Possibly the group will have to come in when text and one of the positions is picked.
It is a bit complex but as soon as I get SW running again I'll try some simple experiments.
What do you think about starting a new thread for this it's getting too far to scroll down and I thing we're off the subject?


Tobin
Tobin.Sparks@nov.com
 
Howdy,

Go to Macro Tab, Drawings Categories, for the latest release of Label View. This version is more user friendly than earlier versions as far as error handling and normal user expectations go (thanks fcsuper). I plan to make other improvements at a later date.

Thanks


Tobin Sparks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor