Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Property set formulas

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
2821 Views, 4 Replies

Property set formulas

I am having problems with my property set definitions.

 

As an example i would like to make the object name visible when i do an export to 3D solids.

I am able to do this in Civil 2018, but I have to use Civil 2015 for this project.

This code works for Civil 2018:

Code start..

RESULT = "--"
On Error Resume Next
Set oApp = GetObject(, "AutoCAD.Application")
Set oCivilApp=oApp.GetInterfaceObject("AeccXUiPipe.AeccPipeApplication.12.0")
Set obj = oCivilApp.ActiveDocument.HandleToObject("[Handle]")
RESULT = obj.Name

Code end..

 

I have figured out that AeccPipeApplication.12.0 is for Civil 2018, but what code is to be used for Civil 2015?

 

Any help on this issue will be appreciated

4 REPLIES 4
Message 2 of 5
norman.yuan
in reply to: Anonymous

Firstly, your question has nothing to do with Property Set. Since Property Set is a rarely discussed topic, mentioning Property Set in the title may lead people to simply skip your post's detail, if they know not much about Property Set.

 

The program ID for COM object AeccPipeApplication in Civil2015 is "AeccXUiPipe.AeccPipeApplication.10.4"

This code work with my Civil2015:

 

 

Public Sub Test()
    
    Dim cadApp As AcadApplication
    Dim pipeApp As AeccPipeApplication
    
    Set cadApp = ThisDrawing.Application
    On Error Resume Next
    Set pipeApp = cadApp.GetInterfaceObject("AeccXUIPipe.AeccPipeApplication.10.4")
    If Err.Number <> 0 Then
        MsgBox "Accessing to Pipe Application failed."
    Else
        MsgBox pipeApp.FullName
    End If
On Error Go 0
'' TO DO .... End Sub

Actually you can get the hint from the folder name where the Civil3D COM type libraries are installed (notice the number suffixed the folder name)

 

 

for Civil2015, it is 

C:\Program Files\Common Files\Autodesk Shared\Civil Engineering 104

 

for Civil2016, it is (my guess, I do not have it installed)

C:\Program Files\Common Files\Autodesk Shared\Civil Engineering 105

 

for Civil2017, it is (my guess, I do not have it installed)

C:\Program Files\Common Files\Autodesk Shared\Civil Engineering 110

 

For Civil2018, it is 

C:\Program Files\Common Files\Autodesk Shared\Civil Engineering 120

 

HTH

Norman Yuan

Drive CAD With Code

EESignature

Message 3 of 5
Anonymous
in reply to: norman.yuan

I might have explained a bit badly, but i am having problems inside the  PROPERTYSETDEFINE area..
If this has nothing to do with property sets, I have misunderstood the whole operation I am trying to do.
I have to export my Networks to 3D solids, but i also need some information in the exported model.

 

I might be way over my head here but the coding i have found online looks like this:PROPERTYSETDEFINE.JPG

Extended data.JPG

 

As far as my researh here goes i need to do this operation to get the data in under "Extended Data" or else the 3D solid model will have no information attached to it

Message 4 of 5
cwr-pae
in reply to: Anonymous

Make sure you have the proper object type selected for the property set to apply to. Apply to everything to verify it an be applied to the object type in question.

 

In the formula select where it has [handle] and highlight it. Then double click the name handle in the Insert Property Definitions box. It should replace the word handle with a link to the handle property in the Insert Property Definitions box, the link has a very faintly grey background when its linked. I can't tell if the you have the proper link in your image.

Next you have to verify the property:

Run this lsp routine and look for the properties you want read for the property set. Not all properties can be read. To make sure of spellings, text can be copied from the F2 window to the formula. Note I renamed the command to odump to avoid conflicts with other routines.

 

;;---------------------=={ Dump Object }==--------------------;;
;;                                                            ;;
;;  Lists the properties & methods of a supplied VLA-Object   ;;
;;  or VLA-Object equivalent of a supplied ename or DXF list. ;;
;;------------------------------------------------------------;;
;;  Author: Lee Mac, Copyright © 2013 - www.lee-mac.com       ;;
;;------------------------------------------------------------;;
;;  Arguments:                                                ;;
;;  obj - VLA-Object, Entity Name, or Entity DXF List         ;;
;;------------------------------------------------------------;;

(defun c:odump  nil (LM:dump (car (entsel))))
(defun c:odumpn nil (LM:dump (car (nentsel))))

(defun LM:dump ( obj )
    (cond
        (   (or (= 'ename (type obj))
                (and (listp obj) (= 'ename (type (setq obj (cdr (assoc -1 obj))))))
            )
            (vlax-dump-object (vlax-ename->vla-object obj) t)
        )
        (   (= 'vla-object (type obj))
            (vlax-dump-object obj t)
        )
    )
    (princ)
)
(vl-load-com) (princ)

Message 5 of 5
javiermend
in reply to: Anonymous

Dear @Anonymous, I see your post and if you want to get the pipe's material , maybe this links and video match your solution.

https://www.youtube.com/watch?v=v97WpUgk0w8

http://blog.civil3dreminders.com/2017/08/property-set-formulas.html

http://blog.civil3dreminders.com/2016/03/freaking-context-values.html

 

Best Regards, 

Javier

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report