OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Corel User Forums > CorelDRAW > Macros/Add-ons

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-11-2012, 09:57
gorgo gorgo is offline
Senior Member
 
Join Date: Feb 2010
Posts: 169
Default RE: inserting text showing current scale

I'm using Brian's world scale macro and I'd like to know how to insert the currently set scale as text in page. I think there is a datastring that's collected somewhere. I'd like to add a button in the form and when pressed it will insert the scale as text. I reckon something will have to pull the value in the scale caption...I hope someone knows what I mean (Shelby?).
Reply With Quote
  #2  
Old 11-11-2012, 18:52
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Hi.
I can get it to print on page when it;s changed in the macro. This is only for Brian's macro. Add after lines shown.

Code:
    uT = 100000 * target / source
    ActiveDocument.Rulers.HUnits = cdrKilometer
    ActiveDocument.Rulers.VUnits = cdrKilometer
    End If

End If
ActiveDocument.WorldScale = uT
'ActiveDocument.ActiveWindow.ActiveView.ToFitPageHeight


'added here below!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
createTextWorldScale source, target 'added
End Sub


'added all of this right below..................................................
Private Function createTextWorldScale(ByVal dVal1#, ByVal dVal2)
    Dim sText As Shape
    Dim strScale$
    strScale = dVal1 & " " & brianComboOne(ComboBox1.ListIndex) & " : " & dVal2 & " " & makeUnitStr(ActiveDocument.Rulers.HUnits)
    Set sText = ActiveLayer.CreateArtisticText(0, 0, strScale)
End Function
Private Function brianComboOne$(ByVal i)
    Select Case i
        Case 0
            brianComboOne = "inches"
        Case 1
            brianComboOne = "millimeters"
        Case 2
            brianComboOne = "centimeters"
    End Select
End Function
Private Function makeUnitStr$(ByVal iUnit&)
    Select Case iUnit
        Case 1:
            makeUnitStr = "inches"
        Case 2:
            makeUnitStr = "feet"
        Case 3:
            makeUnitStr = "millimeters"
        Case 4:
            makeUnitStr = "centimeters"
        Case 5:
            makeUnitStr = "pixels"
        Case 6:
            makeUnitStr = "miles"
        Case 7:
            makeUnitStr = "meters"
        Case 8:
            makeUnitStr = "kilometers"
        Case 9:
            makeUnitStr = "didots"
        Case 10:
            makeUnitStr = "inches"
        Case 11:
            makeUnitStr = "agate"
        Case 12:
            makeUnitStr = "yard"
        Case 13:
            makeUnitStr = "pica"
        Case 14:
            makeUnitStr = "point"
    End Select
End Function
Reply With Quote
  #3  
Old 12-11-2012, 14:43
gorgo gorgo is offline
Senior Member
 
Join Date: Feb 2010
Posts: 169
Default

hmmm...I'm not sure I understand how this code works. How is the scale name text inserted into the document and where? How do I tie this code to a button to insert the scale name text?
Reply With Quote
  #4  
Old 12-11-2012, 16:12
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Hi.
Just insert it where it shows. When you press "scale" on the form it inserts the string at 0,0 but you can change to anywhere you want.
Maybe your BD macro code isn't same?

PS. Are you receiving Oberon Forum emails for new posts? I don't get them anymore.
~John
Reply With Quote
  #5  
Old 12-11-2012, 17:57
gorgo gorgo is offline
Senior Member
 
Join Date: Feb 2010
Posts: 169
Default

thanks John. I'll give it a go. Regarding the e-mail notifications...I don't get them either even though I subscribe. it's weird.
Reply With Quote
  #6  
Old 15-11-2012, 12:54
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

HI.
Seen this post and thought of you. Maybe this will work well for you:

http://coreldraw.com/forums/p/36610/171418.aspx#171418

~John
Reply With Quote
  #7  
Old 16-11-2012, 00:21
gorgo gorgo is offline
Senior Member
 
Join Date: Feb 2010
Posts: 169
Default

ah but I'm using X4 and this is tool introduced in X5. So, moving on...how do I make the text insterted into the page show as 1/4" = 1'-0" as an example?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
detect page edge when inserting text gorgo CorelDRAW/Corel DESIGNER VBA 2 06-05-2012 07:08
Capturing current document scale... gorgo2 CorelDRAW/Corel DESIGNER VBA 0 28-05-2010 19:59
view and print current scale settings mick classen CorelDRAW/Corel DESIGNER VBA 22 23-04-2010 00:00
Display Current Scale Drumart Macros/Add-ons 1 06-07-2006 08:06
Scale a group with text frame daniello Macros/Add-ons 3 21-03-2006 15:54


All times are GMT -5. The time now is 12:50.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com