Results 1 to 5 of 5

Thread: break a line

  1. #1
    Member
    Join Date
    2005-08
    Posts
    17
    Login to Give a bone
    0

    Default break a line

    Can anyone please tell me why the following code wouldnt work? it does all kind of weird stuff when breaking. the only thing i get right is the line.

    thanks

    Code:
    Sub brline()
    Dim startpoint(0 To 2) As Double
    Dim endpoint(0 To 2) As Double
    Dim insertpt(0 To 2) As Double
    
    insertpt(0) = 50
    insertpt(1) = 0
    insertpt(2) = 0
    
    startpoint(0) = 0
    startpoint(1) = 0
    startpoint(2) = 0
    
    endpoint(0) = 100
    endpoint(1) = 0
    endpoint(2) = 0
    
    ThisDrawing.ModelSpace.AddLine startpoint, endpoint
    ThisDrawing.SendCommand "(command " & """" & "break" & """" & " (entlast) '(" & insertpt(0) + 10 & " " & _
                   insertpt(1) & ") '(" & insertpt(0) - 10 & " " & insertpt(1) & "))" & vbCr
    
    End Sub

  2. #2
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,096
    Login to Give a bone
    0

    Default Re: break a line

    If you are going to break the line anyway, why not just draw two seperate lines?
    Code:
    ThisDrawing.ModelSpace.AddLine startpoint, insertpt
    ThisDrawing.ModelSpace.AddLine insertpt, endpoint
    Edit
    Ignore that.
    Sorry, I just saw that you were breaking in two different points.
    Last edited by Opie; 2005-10-03 at 08:53 PM. Reason: Reread the OP
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  3. #3
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,397
    Login to Give a bone
    0

    Default Re: break a line

    Quote Originally Posted by richardl.25628
    If you are going to break the line anyway, why not just draw two seperate lines?
    Code:
    ThisDrawing.ModelSpace.AddLine startpoint, insertpt
    ThisDrawing.ModelSpace.AddLine insertpt, endpoint
    Edit
    Ignore that.
    Sorry, I just saw that you were breaking in two different points.
    You're not that far off. To avoid using SendCommand, use the start and end points of the original line, use the new points to calculate the new lines and then erase the original.

    Kap_78, as for why your code does not work, one possiblity is that osnaps might be throwing you off, esp if Endpoint is turned on. That's just one trouble with using SendCommand.
    C:> ED WORKING....

  4. #4
    Member
    Join Date
    2005-08
    Posts
    17
    Login to Give a bone
    0

    Default Re: break a line

    thanks for your replies.and thnks ed. osnap was indeed the problem. so i just turn it off before breaking and turn on later.
    the thing is this code was only a sample. i have dwgs with plumbing and HVAC pipes. and i need to show breaks where they interesect. i am drawing a line only in this case for testing purpose. but what i want is for user to select the interesection point and then i break the line.

  5. #5
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,397
    Login to Give a bone
    0

    Default Re: break a line

    You can do that simply by changing the macro for the BREAK command. Try this:
    ^C^C_break \f \@0,0
    C:> ED WORKING....

Similar Threads

  1. Annotation - Dynamic Break Line (dyn-break)
    By Kernal_CAD_Monkey in forum Dynamic Blocks - Technical
    Replies: 0
    Last Post: 2012-07-30, 11:28 AM
  2. Annotation - Dynamic Break Line (dyn-break)
    By barry.40197 in forum Dynamic Blocks - Sharing
    Replies: 10
    Last Post: 2011-01-13, 03:41 AM
  3. Line Based Break Line
    By djn in forum Revit Structure - Families
    Replies: 9
    Last Post: 2008-11-24, 07:55 PM
  4. Line Break in a Tag
    By johk in forum Revit - Platform
    Replies: 2
    Last Post: 2008-02-20, 03:17 AM
  5. Break line
    By wse1 in forum Revit Architecture - General
    Replies: 1
    Last Post: 2006-03-04, 11:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •