Ich habe den Beispielcode von CAD-Huebner zur Erzeugung von Cogo-Punkten noch ergänzt und wollte noch benutzerdefinierte Attribute anhängen, mit der Methode SetUserDefinedProbertyValue, aber mit steigt "vlax-invoke-method" aus.
Nachdem das bei ACAD nirgendwo dokumentiert ist, hat jemanf hierzu eine Ahnung?
Die Methode existiert, kann aber damit keine Daten nach Civil schaufeln.
(setq acadObj (vlax-get-acad-object)
aeccApp (connecttocivil) ; connect to Civil
aeccDoc (vlax-get aeccApp "activedocument")
aeccPoints(vlax-get aeccDoc "Points")
pnt (vlax-3d-point 3d) ; define Point
aeccPoint (vla-add aeccPoints pnt) ; create Civil Point
)
(vlax-put-property aeccPoint 'name name) ; add a Point descriptionkey Name
(vlax-put-property aeccPoint 'Layer (strcat "VE-SYMBOL-S" code)) ; add a Point descriptionkey Layer
(vlax-put-property aeccPoint 'Description code) ; add a Point descriptionkey Kurzbeschreibung
(vlax-put-property aeccPoint 'Descriptionformat "$*") ; add a Point descriptionkey Beschreibungsformat
(vlax-put-property aeccPoint 'Style (strcat "S" code)) ; add a Point descriptionkey Punktstil
(vlax-put-property aeccPoint 'LabelStyle "NZ") ; add a Point descriptionkey Punktbeschriftungsstil
(if (/= att1 nil)
(progn
(setq methode (vlax-method-applicable-p aeccPoint 'SetUserDefinedPropertyValue)) ; frägt Methode ab
(if methode
(vlax-invoke-method aeccPoint 'SetUserDefinedPropertyValue (vlax-make-variant schluessel1) (vlax-make-variant "HALLO")) ; add a userdefined Point descriptionkey
)
)
)
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP