.NET

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

aec schedule

148 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 (148 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
Posts: 4
Registered: ‎06-24-2005
Message 3 of 3 (148 Views)

Re: aec schedule

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

Regards
Jose

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you interested in helping shape the Autodesk Community?
We’re looking at a few different ways to improve the “All Forums” landing page and need your feedback! If interested, please take a few minutes to fill out the following Usability Study. Thank you for your time!

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community