.NET

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

aec schedule

151 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 (151 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 (151 Views)

Re: aec schedule

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

Regards
Jose
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.