Using VB Script for aditional data to Property Set

buinhuthuong
Enthusiast

Using VB Script for aditional data to Property Set

buinhuthuong
Enthusiast
Enthusiast

Hi there,

 

I  am using VB Script in Formula Property Definition to add more data for an object.

As the image below, I could get some information such as Inner Structure Width, Inner Structure Length, and Structure Height with these codes.

I would like to get more information in Table 1 such as Wall Thickness, Floor Thickness.

How can I get it by editing my command code?

 

buinhuthuong_0-1714048974866.jpeg

 

These are the command codes that I used in the project.

 

RESULT="--"
On Error Resume Next
Set oApp=GetObject(, "AutoCAD.Application")
Set oCivilApp=oApp.GetInterfaceObject("AeccXUiLand.AeccApplication.13.6")
Set obj=oCivilApp.ActiveDocument.ObjectIDToObject([ObjectID])
If obj.BoundingShape = 1 Then
Result = CStr(obj.StructureInnerDiameterOrWidth*1000)
Else
Result = Cstr(obj.StructureInnerLength*1000) + " x " + CStr(obj.StructureInnerDiameterOrWidth*1000)
End If

 

Thank you for your attention and have a good day.

Reply
Accepted solutions (2)
793 Views
5 Replies
Replies (5)

MikeEvansUK
Advisor
Advisor
Accepted solution

Use the find by context to get data not explicitly exposed.

See below example for material.

 

RESULT=obj.PartDataRecord.FindByContext("Material_Type").Tag

 

Mike

 

Mike Evans

Civil3D 2022 English
Windows 7 Professional 64-bit
Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz (8 CPUs), ~4.0GHz With 32768MB RAM, AMD FirePro V4900, Dedicated Memory: 984 MB, Shared Memory: 814 MB

buinhuthuong
Enthusiast
Enthusiast

Hi Mike,

 

Thanks for your answer,

I am still using your command code, but it has not worked.

 

buinhuthuong_0-1714097835202.jpeg

 

I am a newbie working with VB Script.

For this reason,

If possible, would you please give some specific explanation?

My goal is how can I bring data in this table to Property Set.

 

buinhuthuong_1-1714098210582.jpeg

 

I appreciate it, Mike

0 Likes

buinhuthuong
Enthusiast
Enthusiast

Have anyone would help me? 😶🙄

Have a good day all of you,

0 Likes

rl_jackson
Mentor
Mentor
Accepted solution

I believe what @MikeEvansUK was saying that between the "" is the variable you want exposed to the property set.

 

HTH


Rick Jackson
Survey CAD Technician VI

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes

buinhuthuong
Enthusiast
Enthusiast

Hi,

 @rl_jackson @MikeEvansUK , amazing,

Thank you all for your useful solution.

 

I appreciate it,

0 Likes

Type a product name