Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB App for R14 Not running for 2000i

Status
Not open for further replies.

lrfcbabe

Programmer
Jul 19, 2001
108
US
We have a VB Application written to run against R14.
I am testing it on 2000i. I am not getting any errors, but the application seems to just stop. I don't know why.
AcadDoc.SaveAs "d:\temp.dwg" 'This works
AcadDoc.Open ("d:\31096d8.dwg") 'This does not
they are in the same module as they are above.
What the application does it opens the files selected from a listbox one at a time and extracts the EED data for each object, and exports it to an ASCII file or Database, depending on the users response.

Any Ideas?
 
R14 and beginning with 2000 use a different object model. One for instance, is the MultiDocumentInterface. Check your code against the new object model (Object Browser) and check your code for the changes.

BU
 
OK, the file is opening, now here is my next prob.
dim SSLSPPipe as Object
dim SSLSPPipe as AcadObject
dim SSLSPPipe as AcadGroup
I have tried each of the above, but "intnoitems" still returns 0.
There must be a problem with my group codes, maybe.
Any ideas? Again this was originally written against R14.
There are lines on layers "XTP*" in the file it opens.

Set SSLSPPipe = AcadDoc.SelectionSets.Add("SSLSPPipe")
gpCode(0) = -4
dataVal(0) = &quot;<AND&quot;
gpCode(1) = 8
dataVal(1) = &quot;XTP*&quot;
gpCode(2) = 0
dataVal(2) = &quot;LINE&quot;
gpCode(3) = -4
dataVal(3) = &quot;AND>&quot;
groupCode = gpCode
dataCode = dataVal
SSLSPPipe.Select acSelectionSetAll, , , groupCode, dataCode
intNoItems = 0
intNoItems = SSLSPPipe.Count
'Debug.Print SSLSPPipe.Count
intTemp = 1
If intNoItems > 0 Then
For Each ent In SSLSPPipe 'Loop for each entity in selection set
Call ResetOutputVars
sglPercentComplete = intTemp / intNoItems * 100
intTemp = intTemp + 1
strEntLayer = ent.Layer
strEntType = ent.EntityType
strEntColor = ent.Color
strLineType = ent.Linetype
strLineLinetypeScale = ent.LinetypeScale
If Left(strEntLayer, 3) = &quot;XTP&quot; Then
Call WritePipe
End If
Next ent
End If
 
SSLSPPipe should be AcadSelectionSet, but I would think that the program would not progress as far as it does if this was declared incorrectly. I got it do what you wanted by creating a layer XTP2 and placing a line on it. It returns a count of 1. Make sure gpCode is declared as integer and dataVal, groupCode, and dataCode are variants. Let me know if this helps any.
 
Still no go. Maybe this needs to be a VBA project not just VB. How much of a dif. could it be? I have inlisted the help of the originator.
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top