Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Title Blockx 1

Status
Not open for further replies.

ronin2307

Industrial
Mar 28, 2005
29
Hi,

I was wondering if there is a way to retrieve the information contained in the title block in a SW drawing file using VB.

Thanx
 
Replies continue below

Recommended for you

Yes,

You can extract annotations by many means. You can search for a specific string of text, a location, an area, the whole page, all pages. I used a macro a while back to change the font in all annotations to standardize our drawings, I used another to extract all notes from the drawings and print them to a file. Many things can be done many ways with the annotations, notes, dimensions on a drawing.
 
I would really appreciate it if you could point me into the right direction. I am trying to get the drawing NO. info from the title block.

Thanx
 
I don't have a copy of the macro at home, if no one else jumps in I can post some sample code tomorrow from the office. Determine how the drawing number is noticable, in other words, is it always in the same spot on the drawings, are all the drawings the same size, is there a way to define that the macro has found the drawing number and not some other note on the drawing. Once that is established getting it is relatively simple, but then what would you like to do with it?
 
ronin2307,
Are you putting your title block information into the model properties not drawing properties? If not I suggest you start. Programming and PDM will work alot better if you do.

Bradley
 
this is what I am trying to accomplish:

In the titleblock on each drawing there is a little box, which contains the drawing number. In our case, there is always a letter at the end of that number that indicates what size of print this is (A,B,C,D). I want to get that drawing number from the title block and use it to automatically print out that drawing in the right size paper.

THat was it in the nutshell :)

thanx
 
Just a sidenote:

I am a VB programmer with 00000 experience with SW. Therefore I am tapping in dark for right now and maybe asking really simple questions
 
Well you shouldn't need to get that from the note, I would think sheet properties would be sufficient:
From SW Help
Description
This method gets the properties for this sheet object.

Syntax (OLE Automation)
retval = Sheet.GetProperties ()
Return:
(VARIANT) retval
VARIANT of type SafeArray (see Remarks)

Syntax (COM)
status = Sheet->IGetProperties ( retval )

Output:
(double*) retval
Pointer to an array of doubles (see Remarks)

Return:
(HRESULT)status
S_OK if successful

Remarks
The return value is the following array of seven doubles:
[ paperSize, templateIn, scale1, scale2, firstAngle, width, height ]
where:
paperSize = Paper size. This value is a long packed into a double and is represented by the swDwgPaperSizes_e enumeration:

swDwgPaperAsize
swDwgPaperAsizeVertical
swDwgPaperBsize
swDwgPaperCsize
swDwgPaperDsize
swDwgPaperEsize
swDwgPaperA4size
swDwgPaperA4sizeVertical
swDwgPaperA3size
swDwgPaperA2size
swDwgPaperA1size
swDwgPaperA0size
swDwgPapersUserDefined

templateIn = Template index. This value is a long packed into a double and is represented by the swDwgTemplates_e enumeration.

scale1 = Scale numerator.

scale2 = Scale denominator.

firstAngle = Value is a boolean packed into a double and returns TRUE if the sheet is using first angle projection and FALSE if not.

width = Paper width.

height = Paper height.

NOTE: To ensure a correct return value, open the document in edit mode.
 
Why have the sht size in the dwg number?
Print out per sheet properties.

Chris
Sr. Mechanical Designer, CAD
SolidWorks 05 SP1.1 / PDMWorks 05
ctopher's home site
 
Do not take me wrong here. It is not a good idea to have the drawing number or file name contain the drawing size. If you change the drawing from a “B” size to a “C” size your drawing number would change. Which means every location that part is referenced would have to be “ECO’ed”. You should be able to change the file name in the part model and the drawing name would match.

Follow aamoroso style. aamoroso has the right idea. And get your management to remove the drawing size. We used to do that in the 1970’s before computers. That way we knew what drawer to get the drawing from.


Bradley
 
Chris you get a star for that one.
I often wonder how engineering companies get so off track of what is right. Maybe it is a startup company.


Bradley
 
Yeah, good point Bradley, engineering companies do get off track easliy. Often old obsolete procedures hang around way too long. It's kind of funny from my point of view, cause I never print from my PC. Everything we print is a DXF from a Mac.

As for ronin, it seems to me like he has little say in the policy but is making a valient effort at simplifying it. There is another thing that happens in manufacturing places allot, the engineering policies being dictated by higher ups. That is one that burns me up, they have no clue how simple our jobs could be if they would step back and quit the micro managing.

Oh boy, now you got me started [soapbox]
 
Thanks Bradley. I agree aamoroso, we have that problem here with our new management. Burns me up too!

Chris
Sr. Mechanical Designer, CAD
SolidWorks 05 SP1.1 / PDMWorks 05
ctopher's home site
 
to all of you guys:

thank you very much for all your help. I have to admit that yesterday shortly before calling it a day, I figured out the whole sheet.getproperties() method and I did get what I needed.
As for the procedures and the drawings themselves, I do have 0 say in any of that stuff, since I am not a design engineer, but a software engineer. And as mentioned earlier I have no idea how to use SW and what is a good way of doing things within SW. All I am asked to acommplish is to automate a whole bunch of unneccessary manual labor.

Therefore most of the time I am walking in the black box as far as SW is concerned, since even the terminology used in SW is an unknown.

However, once again thanx since this is the only way for me to figure out how to get around in SW.

Iggy
 
Iggy,
I have been called an enabler here at work. I would write programs to help drafters do something that was wrong by engineering standards. I enjoyed the challenge.

My suggestion would be to play politics before it is too late to change. Get to know the person who is controlling SolidWorks. Learn from this form what is right and talk to the SolidWorks person about what you have learned. You could even point them to this web site. I just hate to see new old school ways incorporated into the new way of doing this. By the way I am old school trained on the drawing board for years before computers came along.

Another bit of advice I give people is find some type of work that is not your job (at work of course) and do it. With you programming in VB, you could learn SolidWorks and you would have a very saleable commodity.


Bradley
 
Bradley,

Once again thank you for your advice. I welcome programming challenges as well, especially when I am dealing with a task which I am completely unfamiliar with. With that said I do believe that learning new things will never hurt, and therefore I am trying to learn as much about SW as I possibly can. Given that the learning curve for me is huge since I am not a designer, it is challenging, but then again nobody was born a genius. SOmewhere along the line everybody has got to learn something.

I just need to learn more before I can make my voice heard, since it would be hard even for a horrible engineer to listen to somebody who has never used SW before :)

Iggy
 
Iggy,
Yes, what you are saying is very true. SolidWorks allows you to take a license home. You have VB at home. Go through the tutorial just enough to learn what you need. Creating blocks, formats, Bills of Material, and printing is a good start. Then write a few good programs to save them time and then they will ask for more, of course this time it would be done at work. The basics of SolidWorks is not hard to learn.

Of course this would be easy if one does not have a life. My wife hated me during the first several months we started SolidWorks at work, going from AutoCAD. I did not want everyone filling in the title block by hand. I did not know VB and learned just enough while creating a title block program. It is not well written by programmers standards but the Engineers cannot see behind the dialog box.


Bradley
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor