.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

aec schedule

2 REPLIES 2
Reply
Message 1 of 3
Josefilho
391 Views, 2 Replies

aec schedule

I tried to run the following in VB 2005 Express, to create wall properties, but there is an error at a the line:
doc = AecArchBaseApplication.ActiveDocument
and the error is:
Reference to a non shared member requires an object reference

Please, how can I fix this? I tried in vba and it worked fine.

The routine is:
Public Class CreaWProp
_
Public Sub df()
Call CreateWallProp()
End Sub

Sub CreateWallProp()
Const newSetName As String = "WallProp"
Dim ScheduleApp As New AecScheduleApplication
Dim doc As AecArchBaseApplication

doc = AecArchBaseApplication.ActiveDocument
Dim util As AcadUtility
util = doc.Utility
Dim cPSs As AecSchedulePropertySets
Dim pS As AecSchedulePropertySet
Dim cPSDs As AecSchedulePropertySetDefs
cPSDs = ScheduleApp.PropertySetDefs(doc.Database)
Dim bHas As Boolean
bHas = cPSDs.Has(newSetName)
Dim PSD As AecSchedulePropertySetDef
If Not bHas Then
PSD = cPSDs.Add(newSetName)
PSD.Description = "Wall PropSetDef"
Dim appliesToFilter(0) As String
appliesToFilter(0) = "AecDbWall"
PSD.AppliesTo = appliesToFilter
Dim cPDs As AecSchedulePropertyDefs
Dim PD As AecSchedulePropertyDef
cPDs = PSD.PropertyDefs
PD = cPDs.Add("Handle")
Dim s(0 To 0) As String
s(0) = "AecDbWall:Handle"
PD.QueryExpression = s
PD = cPDs.Add("Description")
s(0) = "AecDbWall:Description"
PD.QueryExpression = s
PD = cPDs.Add("Height")
PD.Format = "Length - Short"
s(0) = "AecDbWall:Height"
PD.QueryExpression = s
PD.Type = AecSchedulePropertyDefType.aecSchedulePropertyTypeReal
PD = cPDs.Add("Width")
PD.Format = "Length - Short"
s(0) = "AecDbWall:Width"
PD.QueryExpression = s
PD.Type = AecSchedulePropertyDefType.aecSchedulePropertyTypeReal
PD = cPDs.Add("Length")
PD.Format = "Length - Short"
s(0) = "AecDbWall:Length"
PD.QueryExpression = s
PD.Type = AecSchedulePropertyDefType.aecSchedulePropertyTypeReal
PD = cPDs.Add("AreaRigh")
PD.Format = "Area"
s(0) = "AecDbWall:Area - Right Net"
PD.QueryExpression = s
PD.Type = AecSchedulePropertyDefType.aecSchedulePropertyTypeReal
PD = cPDs.Add("AreaLeft")
PD.Format = "Area"
s(0) = "AecDbWall:Area - Left Net"
PD.QueryExpression = s
PD.Type = AecSchedulePropertyDefType.aecSchedulePropertyTypeReal
PD = cPDs.Add("VolumeNet")
PD.Format = "Area"
s(0) = "AecDbWall:Volume - Net"
PD.QueryExpression = s
PD.Type = AecSchedulePropertyDefType.aecSchedulePropertyTypeReal
End If
PSD = cPSDs.Item(newSetName)
End Sub
End Class

Thanks in advance for help me.
regards
Jose
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Josefilho

Notice what your doc variable is dim'd to hold vs. what you're trying to
assign to it.
--
Bobby C. Jones
Message 3 of 3
Josefilho
in reply to: Josefilho

Thank you.

Regards
Jose

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost