Property Sets - Formula property definition - Insert VBScript Code blank

Property Sets - Formula property definition - Insert VBScript Code blank

Anonymous
Not applicable
4,543 Views
6 Replies
Message 1 of 7

Property Sets - Formula property definition - Insert VBScript Code blank

Anonymous
Not applicable

Hi!

I'm trying to set a Formula Property but it's not working.

I believe that the problem is related to the Insert VBScript code that is blank.

 

Please, anyone can help me?

 

Formula definition.JPG

 



0 Likes
Accepted solutions (1)
4,544 Views
6 Replies
Replies (6)
Message 2 of 7

Karadzhaian_Eduard
Advisor
Advisor

@Anonymous hi,

I use Property Set Data to define different objects properties, then using formulas generate different values and schedules.

I can show you how correctly get different object's properties. For example, AutoCAD solids, I want to generate volume value in Property Set Data:

 

In formula's field I need to get this:

RESULT="--"
On ERROR RESUME NEXT
Set oApp=GetObject(,"AutoCAD.Application")
Set obj=oApp.ActiveDocument.ObjectIDToObject("[ObjectID]")
RESULT=obj.Volume

 

First and second strings RESULT="--" 

On ERROR RESUME NEXT are constant

Third string Set oApp=GetObject(,"AutoCAD.Application") is connection to AutoCAD .dll file (for Civil 3D you need to use different files)

Fourth string Set obj=oApp.ActiveDocument.ObjectIDToObject("[ObjectID]") defining object's ID (Handle for Civil 3D objects)

Fifth string RESULT=obj.Volume defining object's property you wanna see in Property Set Data (full list you can find in API manual)

 

Be aware: before creating this formula you need to define ObjectID (Handle for Civil 3D objects) as a property :smileyhappyСнимок.PNG


Eduard Karadzhaian
Senior Civil Infrastructure Engineer
Blog| LinkedIn| E-mail| Youtube|



Message 3 of 7

jorge.moinovaamonde
Explorer
Explorer
Accepted solution

Hi joaolgmartins,

I think your formulas are correct, it's simply that you forgot to close your statement with "End if" to make it work. Don't worry about the Insert VBScript code blank window, I have it also blank and it works. Find below some screenshots.

Hope this is solving your question.

Vol_unit=0Vol_unit=0Vol_unit=1Vol_unit=1

Message 4 of 7

Anonymous
Not applicable

Thanks a lot @jorge.moinovaamonde!


Worked here! Reallt the Insert VBScript Code blank isn't a problem.

0 Likes
Message 5 of 7

Anonymous
Not applicable

Hi, 

I have kind of the same problem, the Insert VBScritpt is not working, on top of that none of the vba commands is recognized by the compiler.

Any help is well received.

 

Thanks in advance.

0 Likes
Message 6 of 7

gabriela.rodriguezRSL95
Explorer
Explorer

Hi, I use Property Set Data to define the area for two different solids. One solid has 0.10m of thickness and the other has 0.15m. So I use the property set If ... Then ... Else, but it doesn`t work:

gabrielarodriguezRSL95_0-1651011136509.png

 

A="[09_INGENIERÍA:NL_ING_Etiqueta]"
If A="P401" Then
RESULT=[IP_QTY_Medición Ejecucion]/0.1
ElseIf A="P403" Then
RESULT=[IP_QTY_Medición Ejecucion]/0.15
Else
0
End If

 

Can you help me, please? 

Thanks

0 Likes
Message 7 of 7

edcanonb
Contributor
Contributor

Thank you, good day. How is it possible in a variable to put a counter of objects or blocks? Is it possible and store it on a pset? Thank you

0 Likes