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!

Drawing Scale ??

Status
Not open for further replies.

Alan Lowbands

Aerospace
May 17, 2017
274
Hi All,

I'm stumped again and hoped someone may have a simple solution.

I'm trying to auto-populate a drawing sheet. I have managed to get everything I need except the drawing scale.
This code gets it but its not in a ratio format.
Set at a scale of 10:1 it reports 0.1
Is there a way of getting it to report it as 10:1 ?

Set oFrontViewScale = DrwSheet.Views.Item(3)
oScale = oFrontViewScale.scale
Set DrwText = DrwTexts.GetItem("Text.223M") 'Sheet Scale
DrwText.text = oScale

thanks
Alan
 
Replies continue below

Recommended for you

As you've seen, the output reports the scale as a multiplier, and not as ratio as we commonly write. The way I solved this was to make a series of conditions. It's been long enough I forgot how, but I think I used a select case routine. I mapped out all the common scales that I considered appropriate for our engineering drawings, something like this:
case: scale = 2, then drawing text = "2:1"
case: scale = 1, then drawing text = "1:1"
case: scale = 0.5, then drawing text = "1:2"
case: scale = 0.25, then drawing text = "1:4"
case: scale = =.05, then drawing text = "1:20"
...and so on, according to what seemed reasonable. The list was not very long, something like 10 or 15 lines.
For all the oddball scales that people could put like "5:7 scale", I filled the value with "NTS" i.e. Not To Scale.

Not at all sure this is the best idea, but it did suffice for my purposes. Hope this helps.

Mark
 
Thanks MarkAF

I've tried using this and it works apart from 1:3
Can't get it to do that one no matter how many 3's I use.
Maybe trying to use a formula 3 divided by one may work ?

If oScale = 1 then oScale2 = "1:1 AND AS NOTED "
If oScale = 0.5 then oScale2 = "1:2 AND AS NOTED"
If oScale = 0.333 then oScale2 = "1:3 AND AS NOTED"
If oScale = 0.2 then oScale2 = "1:5 AND AS NOTED"
If oScale = 0.1 then oScale2 = "1:10 AND AS NOTED"
If oScale = 0.05 then oScale2 = "1:20 AND AS NOTED"
If oScale = 20 then oScale2 = "20:1 AND AS NOTED"
If oScale = 10 then oScale2 = "10:1 AND AS NOTED"
If oScale = 5 then oScale2 = "5:1 AND AS NOTED"
If oScale = 3 then oScale2 = "3:1 AND AS NOTED"
If oScale = 2 then oScale2 = "2:1 AND AS NOTED"
 
That worked :)

If oScale <> 0 then oScale2 = "NOT TO SCALE"
intA = 1
intB = 3
intC = intA/intB
If oScale = 1 then oScale2 = "1:1 AND AS NOTED "
If oScale = 0.5 then oScale2 = "1:2 AND AS NOTED"
If oScale = intC then oScale2 = "1:3 AND AS NOTED"
If oScale = 0.2 then oScale2 = "1:5 AND AS NOTED"
If oScale = 0.1 then oScale2 = "1:10 AND AS NOTED"
If oScale = 0.05 then oScale2 = "1:20 AND AS NOTED"
If oScale = 20 then oScale2 = "20:1 AND AS NOTED"
If oScale = 10 then oScale2 = "10:1 AND AS NOTED"
If oScale = 5 then oScale2 = "5:1 AND AS NOTED"
If oScale = 3 then oScale2 = "3:1 AND AS NOTED"
If oScale = 2 then oScale2 = "2:1 AND AS NOTED"
 
1. Find the "V5Automation.chm" file on your CATIA installation path.

2. Search for "DrawingView.InsertViewScale".


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor