.NET

Reply
Member
Josefilho
Posts: 4
Registered: ‎06-24-2005
Message 1 of 3 (155 Views)

aec schedule

155 Views, 2 Replies
06-25-2005 09:25 AM
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:smileyvery-happy:escription"
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
*Bobby C. Jones
Message 2 of 3 (155 Views)

Re: aec schedule

06-27-2005 08:01 AM 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
Member
Josefilho
Posts: 4
Registered: ‎06-24-2005
Message 3 of 3 (155 Views)

Re: aec schedule

06-27-2005 01:27 PM in reply to: Josefilho
Thank you.

Regards
Jose
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!