Can you post the files you are using?
Can you post the files you are using?
Ok I did the debug, see attachment, but its skipping over all the if statments for some reason.?
My {Tube Amp} Building Forum
http://www.dreamtone.org/Forum/
That means the frames are not equal. The frames HAVE to start with the same number in both files.
Oh shoot, ok let me fix......
Thanks
My {Tube Amp} Building Forum
http://www.dreamtone.org/Forum/
Tommy thats awesome! Nice job!!
Now I have a nice platform to work with, I will have to see if I have any doe in my paypal account,...just checked it but it only had like $3.00 left so I am going to transfer some doe in and make a donation to this web site within the next week or as soon as possible! You guys are the BEST!
Rob
PS Thanks to Fatty also.....always willing to help out as well!!
My {Tube Amp} Building Forum
http://www.dreamtone.org/Forum/
Glad we could Help
Don't forget to mark it solved
I will, but will that lock this tread?
I am try too modify polylines to just a typical line:
[VBA]
'Dim mPoly As Acad3DPolyline
Dim mPoly As AcadLine
[/VBA]
But this is giving me trouble:
[VBA]
If mStr > 0 Then Set mPoly = ThisDrawing.ModelSpace.Add3DPoly(FramArray)
'If mStr > 0 Then Set mPoly = ThisDrawing.ModelSpace.Add3DPoly(FramArray)
[/VBA]
My {Tube Amp} Building Forum
http://www.dreamtone.org/Forum/
A quick and dirty:
[VBA]
If mStr > 0 Then
Set mPoly = ThisDrawing.ModelSpace.Add3DPoly(FramArray)
mPoly.Explode
End If
[/VBA]
Otherwise you would need to rewrite the sub a lot.
Right, actually a 3Dpolyline is fine. I got off track and was thinking it was a spline my bad.
My {Tube Amp} Building Forum
http://www.dreamtone.org/Forum/
Would you like to draw the whole frame instead of half the frame?
Sure, since its code. Oh I think there are double lines going in not sure but zoom in at the ends and explode and erase then you will see what I mean.
Its cool though...
My {Tube Amp} Building Forum
http://www.dreamtone.org/Forum/
Double line = double input
Yup......my text file again....Originally Posted by Tommy
My {Tube Amp} Building Forum
http://www.dreamtone.org/Forum/
Whew glad it wasn't me. LOL I was thinking while I mowed the yard "I sure hope I don't have a sna-phoo"
This should give you the full frame.
[VBA]
'iFileName needs to contain the full path to the file with the extension
Function OpenFile(iFileName As String) As Long
Dim mFrFle As Long
'Close
mFrFle = FreeFile
On Error GoTo OPPS
Open iFileName For Input As #mFrFle
OpenFile = mFrFle
On Error GoTo 0
Exit Function
OPPS:
MsgBox Err.Description
Close mFrFle 'close the file you just tried to open and release the id
Err.Clear
End Function
Sub ReadFileIntoArray()
Dim ZId As Long, XYID As Long, mFrmNo As Long, mFrameLoc As Double
Dim mXYFrmID As Long, mY As Double, mX As Double, mXYID As Long
Dim FramArray() As Double, mStr As Long, mNextRec As Boolean, dum As String
Dim mPoly As Acad3DPolyline
ReDim FramArray(0)
'Z cords
ZId = OpenFile("C:\Projects\txt files and pics\Frame_Spacings.txt")
'x and y
XYID = OpenFile("C:\Projects\txt files and pics\Frame_Profiles.txt")
mNextRec = True
While Not EOF(ZId)
Input #ZId, mFrmNo
Input #ZId, dum, mFrameLoc
If mNextRec Then Input #XYID, mXYID, dum
While mXYID = mFrmNo
If Not EOF(XYID) Then
Input #XYID, mY, mX
mStr = UBound(FramArray, 1)
If mStr = 0 Then
ReDim Preserve FramArray(mStr + 5)
FramArray(mStr) = mX
FramArray(mStr + 1) = mY
FramArray(mStr + 2) = mFrameLoc
FramArray(mStr + 3) = -mX
FramArray(mStr + 4) = mY
FramArray(mStr + 5) = mFrameLoc
Else
ReDim Preserve FramArray(mStr + 6)
FramArray(mStr + 1) = mX
FramArray(mStr + 2) = mY
FramArray(mStr + 3) = mFrameLoc
FramArray(mStr + 4) = -mX
FramArray(mStr + 5) = mY
FramArray(mStr + 6) = mFrameLoc
End If
If Not EOF(XYID) Then Input #XYID, mXYID, dum
mNextRec = False
Else
mXYID = 500000
End If
Wend
If mStr > 0 Then
SortaPoint FramArray
Set mPoly = ThisDrawing.ModelSpace.Add3DPoly(FramArray)
End If
ReDim FramArray(0)
ZoomAll
Wend
End Sub
'standard bubble sort for the points on the x plane
Public Sub SortaPoint(MyPoints() As Double)
Dim mTmp As Double
Dim J As Integer
Dim K As Integer
Dim L As Integer
J = UBound(MyPoints) '<- find the max number of points
For K = 0 To J - 3 Step 3
For L = K + 3 To J Step 3
If MyPoints(K) > MyPoints(L) Then
mTmp = MyPoints(K)
MyPoints(K) = MyPoints(L)
MyPoints(L) = mTmp
mTmp = MyPoints(K + 1)
MyPoints(K + 1) = MyPoints(L + 1)
MyPoints(L + 1) = mTmp
mTmp = MyPoints(K + 2)
MyPoints(K + 2) = MyPoints(L + 2)
MyPoints(L + 2) = mTmp
End If
Next
Next
End Sub
[/VBA]
Tommy, would this code by any chance read it out of a pdf file?Originally Posted by Tommy
Its brutal typing in all this data, thats what I am doing now....
My {Tube Amp} Building Forum
http://www.dreamtone.org/Forum/
Ummm Adobe reader 8 has the option to save as text. Otherwise e-mail it to me and I'll see what I can do.
Even if the data chart in the pdf file is a jpg, will it still convert that to a txt file? Because thats what I have.
My {Tube Amp} Building Forum
http://www.dreamtone.org/Forum/
No not that I am aware of.
Go ahead and send it to me and let me see what I can do. I have a lot of tricks up me sleeve.
Sent
My {Tube Amp} Building Forum
http://www.dreamtone.org/Forum/