Jump to content

Copying splines between drawings - wtf?


Hickoz_bro

Recommended Posts

Hi guys,

 

Got a strange problem when copying geometry that contains splines between drawings.

 

The image below shows the results, the white dashed line shows the copy result, the blue dots are the control points, and the red line shows the copy input.

 

It seems that the control points are correct, but the tangencies of those points, or control vertices are WAAAAAY out... Has anyone else encountered this problem? Any suggestions on how to fix it?

 

I also get the same result when inserting the geometry as a block...

 

9-05-201211-44-33AM.jpg

 

Any ideas?

Link to comment
Share on other sites

Are you pasting to original coordinates?

Drawings are both METRIC or IMPERIAL, meaning no template disparity between the two?

Have you tried a REGEN after copying it in?

Link to comment
Share on other sites

Nah, copied from a dxf from a supplier and pasted into our company template.

 

Yes, tried Regen.

 

Just noticed too, that the original spline isn't healthy either, just not nearly as obvious... ******...

 

Going to investigate some VBA... any suggestions in the meantime?

Link to comment
Share on other sites

Not really, aside from 'GARBAGE IN, GARBAGE OUT', and I understand that the problem is not your doing, but came with the turf, if you will. :)

The one bit of recurring advice which will never steer me wrong, and might help just about anybody is check out http://www.lee-mac.com/index.html

Lee may have something there which will help you.

If not with this specific issue, certainly with something else, perhaps even a larger problem.

Thanks Lee! :beer:

 

I don't use enough splines to be definitive on them, but here are the SPLINE related system variables in Autocad 2012, you might want to click on each of them and consider the ramifications of choosing different variable settings.

 

You might want to save a .svf before you start switching too much stuff, or else take notes of what you are changing, in case you decide that you want to go back to how everything was previously.

spline related variables to check out..JPG

Link to comment
Share on other sites

Thanks for the Tip...

 

What I ended up doing was write a simple and quite crude script to just run through the drawing and redraw ALL splines since I couldn't find a single healthy spline.

 

It looks something like this:

 

Sub SplineRedraw()

Dim Drg As AcadDocument
Dim col As New Collection
Dim spl As Object
Dim X1 As Integer
Dim NegCol As New Collection

Set Drg = Application.ActiveDocument
X1 = 0
For Each spl In Drg.ModelSpace()

On Error Resume Next
  If TypeOf spl Is IAcadSpline2 Then
     If Not Err = 0 Then Stop
     
     If spl.Area <= 0 Then
        Call NegCol.Add(spl)
        GoTo NextSPL
     End If
     X1 = X1 + 1
     
     Call col.Add(spl)
     If Not IsEmpty(col.Item(X1).FitPoints) Then
        Drg.ModelSpace.AddSpline col.Item(X1).FitPoints, col.Item(X1).StartTangent, col.Item(X1).EndTangent
        spl.Delete
     End If

  End If
  
NextSPL:
Next spl

MsgBox X1 & " Splines redrawn."

End Sub

 

I noticed that there are some VERY strange spline occurances which simply crashed AutoCAD when it queried these instances... I'm guessing, but I suspect it might have something to do with the size of the individual spline relative to the overall drawing boundaries... I've run into a similar problem in the past...

 

Either way, I managed to get it to work by first isolating the problem splines, running the script then re-introducing any other data...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...