OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-12-2005, 23:10
Booker
Guest
 
Posts: n/a
Unhappy [NewbieQ] All Curves plz

OK, i have been fiddling with vba scripts for a small while and trying like hell
to go by some of the samples in the drawvba.chm help file and whats posted here.

I managed a few items within draw and got some decent results.
I been reading this forum too for a while and got an idea but it isnt enough.
Googling vba/coreldraw just brings me back here and there is enough
for a newbie to do, meaning there are things mentioned but small
portions of code or lines of code posted and sometimes leaving you stuck in the forest.

I've done me damnedest to figger this out and i get no where or one object
is a good result leaving the rest at original state.

Im sure theres a batch other people in my position that would like to get easier answers to things like this. It's tough and remember, you were once in a shoe as mine.

The simplest of simplest is what i need.....

I have 1 or more objects selected. In the mix, it can be an Ellipse, a Rectangle or some other 'line' shape. I need a simple code that will:

------------------------------------------------------
Select All & Convert all Lines to curves and cusp nodes (for the Ellipses)
I would like NOT to have any Smooth or Symmetrical curves
------------------------------------------------------


** Is there any type book that may have a better learning tutorial on VBA for Coreldraw... not Excell out there that one could buy?


Thanx all who reply
I await your help

-B
Reply With Quote
  #2  
Old 10-12-2005, 23:52
Shaddy
Guest
 
Posts: n/a
Default

try this. It doesn't target specific shapes, you'll need an if/than statement looking for things in the for/next loop (kinda like If s.Type = cdrEllipseShape Then...) But since I'm not exactly sure, I just left it general.

Code:
Sub TempTest()
  Dim sr As ShapeRange
  Set sr = ActiveSelectionRange
  Dim s As Shape
  Dim nr As NodeRange
  For Each s In sr
    s.ConvertToCurves
    Set nr = s.Curve.SubPaths(1).Nodes.All
    nr.SegmentRange.SetType cdrCurveSegment
    nr.SetType cdrCuspNode
  Next s
End Sub
Shaddy

Last edited by Shaddy; 11-12-2005 at 00:13.
Reply With Quote
  #3  
Old 11-12-2005, 06:52
Booker
Guest
 
Posts: n/a
Thumbs up

Thanks Shaddy that worked fine for the objects.

How about text... I didnt include that. I tried it on some text before
and nothing happened. But if I broke it apart and then retried it, it worked.

What needs to be added for the 'combined' objects? (Insides of B, D, R, etc)

forgive me for i am dense and just woke up

Last edited by Booker; 11-12-2005 at 07:12.
Reply With Quote
  #4  
Old 12-12-2005, 00:59
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,941
Blog Entries: 4
Default

The Shaddy's code only convert the nodes of the first subpath to lines. But if you need all the segments/curves, just a slight modification of the code will do the trick (I have also changed the node setting to cusp before converting segments to lines):

Code:
Sub TempTest()
  Dim sr As ShapeRange
  Set sr = ActiveSelectionRange
  Dim s As Shape
  Dim nr As NodeRange
  For Each s In sr
    s.ConvertToCurves
    Set nr = s.Curve.Nodes.All
    nr.SetType cdrCuspNode
    nr.SegmentRange.SetType cdrCurveSegment
  Next s
End Sub
As for something to read, you'd better start with CorelDRAW VBA Programming Guide file included in CorelDRAW installation. In Draw 12 just go to Start>Programs>CorelDRAW Graphics Suite 12>Documentation and you will find the PDF file. Or just go to Programs folder of CorelDRAW installation and look for dvba_pg.pdf (C:\Program Files\Corel\Corel Graphics 12\Programs\dvba_pg.pdf). I'm sure it will be very useful for you.
Reply With Quote
  #5  
Old 12-12-2005, 17:44
Booker
Guest
 
Posts: n/a
Default

Yes Alex thanks for your reply also... The PDF is open at all times for me
and well sometimes it can be frustrating. Im trying to get a grasp of the severe
basics and coming along i think ok. Im just trying to get others in my position to step up and ask Q's and whatnot. I'd like to see some activity so I guess i'll be asking the lamest of the lame questions. I hope the rest dont mind my dense learning but hopefully others could benefit also.

Anyways, thanx all

B ker
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
Recreating curves in VBA code Alex CorelDRAW/Corel DESIGNER VBA 19 05-03-2011 20:37
How can I find shortest distance between two curves, shapes? Jab CorelDRAW/Corel DESIGNER VBA 3 22-12-2004 13:16
Convert barcode to curves pp21 New product ideas 1 10-03-2004 22:56
Corel to DXF - curves too jagged for laser cut out letters knight74 New product ideas 2 19-02-2004 08:49
[b]Smoothing curves[/b] LOT CorelDRAW/Corel DESIGNER VBA 2 11-02-2004 08:24


All times are GMT -5. The time now is 06:37.


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