Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
How do I invoke a vlax method in lisp that requires enumerations? Here's my code. It is a port of some VBA code (which works fine), to add custom properties to pipe network parts.
(defun c:PipesExtraProp( / vrs appstr acad aeccApp aeccDoc oSettings oPipeNetworkCatDef param ) (vl-load-com) (setq vrs (vlax-product-key)) (cond ((vl-string-search "R18.1" vrs) (setq appstr "8.0")) ;2011 ((vl-string-search "R18.2" vrs) (setq appstr "9.0")) ;2012 ((vl-string-search "R19.0" vrs) (setq appstr "10.0")) ;2013 ((vl-string-search "R19.1" vrs) (setq appstr "10.3")) ;2014 (t (alert "This command does not support this version of Civil 3D.")) ) (if (and appstr (or acad (setq acad (vlax-get-acad-object) ) ) (or aeccApp (setq aeccApp (vla-getinterfaceobject acad (strcat "AeccXUiPipe.AeccPipeApplication." appstr) ) ) ) (or aeccDoc (setq aeccDoc (vlax-get aeccApp 'ActiveDocument) ) ) ) (progn (setq oSettings (vlax-get aeccDoc 'Settings) ) (setq oPipeNetworkCatDef (vlax-get oSettings 'PipeNetworkCatDef) ) (setq param (vlax-invoke-method oPipeNetworkCatDef 'DeclareNewParameter "TimeOfConcentration" "TimeOfConcentration" "TIME" "TimeOfConcentration" <<aeccDouble>> <<aeccDoubleGeneral>> "" :vlax-true :vlax-false) ) (setq param (vlax-invoke-method oPipeNetworkCatDef 'DeclarePartProperty "TimeOfConcentration" <<aeccDomPipe>> 8.0) ) ) ) (princ) )
I can't figure out how to add the enumerations:
aeccDouble (type AeccPartDataFieldType),
aeccDoubleGeneral (type AeccPipeNetworkUsage),
aeccDomPipe (type AeccPipeNetworkDomain).
Porting the code to .net would obviously be acceptable, but I have been unsuccessful there too. Thanks for any insights.
Solved! Go to Solution.