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 15-08-2014, 14:03
nic nic is offline
Member
 
Join Date: May 2009
Posts: 90
Default Loop thru shapes and break at nodes

This fails with Node belongs to another shape error - Ive had a read of the previous posts but still cant see how Im to do this. Given the macro is run on a doc which only has curves Im looking for help to make this macro break them all up into two node curves, I can see the nr needs to be reset to blank each time but cant see how to do it. Any help appreciated.

Code:
Sub BreakNodes()
    
    Dim s As Shape
    Dim sr As ShapeRange
    
    Dim n As Node
    Dim nr As New NodeRange
    
    Set sr = ActivePage.Shapes.FindShapes()

    For Each s In sr
       
        For Each n In s.Curve.Nodes
          nr.Add n
        Next n
        
        nr.BreakApart
        s.BreakApart
                       
   Next s

End Sub

Last edited by nic; 15-08-2014 at 14:27.
Reply With Quote
  #2  
Old 17-08-2014, 10:23
shark shark is offline
Senior Member
 
Join Date: Aug 2010
Location: Russia, Belgorod
Posts: 146
Default

Hi.
After nr.BreakApart you need to use nr.RemoveAll.
Reply With Quote
  #3  
Old 17-08-2014, 14:13
nic nic is offline
Member
 
Join Date: May 2009
Posts: 90
Default Thanks

Thanks Shark - that works
Reply With Quote
  #4  
Old 11-03-2016, 14:26
dungbtl's Avatar
dungbtl dungbtl is offline
Senior Member
 
Join Date: Apr 2004
Posts: 155
Default

Hey thats cool.

Now what about reversing it?

Anotherwords, I have single stroke letters for engraving.
Sometimes the characters get broken up at the nodes
resulting in many segments, line/curves.

Anyway to rejoin what is touching?

I could have sworn there was code that does this.

X4 for me
Reply With Quote
  #5  
Old 11-03-2016, 15:14
nic nic is offline
Member
 
Join Date: May 2009
Posts: 90
Default

does this help?

http://forum.oberonplace.com/showthread.php?t=8155

Code:
Sub joinCurves()
Dim s As Shape
Dim sr As ShapeRange


     
Set sr = ActiveLayer.Shapes.FindShapes()
     
     For Each s In sr
         
        ActiveShape.CustomCommand "ConvertTo", "JoinCurves", 0.1
    Next s
End Sub

Last edited by nic; 11-03-2016 at 15:20.
Reply With Quote
  #6  
Old 13-03-2016, 05:58
dungbtl's Avatar
dungbtl dungbtl is offline
Senior Member
 
Join Date: Apr 2004
Posts: 155
Default

Run time error -2421354352345345235

and Shells didnt either because its in X5.

Another time maybe. Thanks
Reply With Quote
Reply

Tags
noderange loop


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
Do...loop error noj CorelDRAW/Corel DESIGNER VBA 2 19-10-2011 09:25
Can't loop thru layers xxxslowjoe CorelDRAW/Corel DESIGNER VBA 1 06-06-2009 12:52
Simple Loop? dan CorelDRAW/Corel DESIGNER VBA 3 13-10-2004 13:31
Gradient + Break Apart Hernán New product ideas 6 25-04-2004 14:34
+ Break Apart Hernán CurveWorks 1 15-02-2004 16:49


All times are GMT -5. The time now is 00:31.


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