0 Members and 1 Guest are viewing this topic.
Sorry, I mean that how to identify the mech/vanilla version in Autolisp.
(defun c:MechOrVanil(/ @getActiveProfile Prof)(defun @getActiveProfile () (vla-get-activeprofile (vla-get-profiles (vla-get-preferences (vlax-get-acad-object))) ))(setq Prof (strcase (@getActiveProfile)))(cond ((= Prof "ACADM") (princ "\nAutoCAD")) ((= Prof "ACADMPP") (princ "\nAutoCAD")) ((= Prof "VANILLA") (princ "\nAutoCAD Mechanical")) (t (princ "\nNo basic profile")))(princ))
Mechanical is simply Vanilla AutoCAD with Add-ons.
(if (member "acadm.arx" (arx)) (alert "This is Mechanical"))
Check here, you can use the path method. But there must be another way.http://www.theswamp.org/index.php?topic=36606.0
"C:\\program files\\autodesk\\acadm 2011\\..."
...Try this:Code: [Select](defun c:MechOrVanil(/ @getActiveProfile Prof)(defun @getActiveProfile () (vla-get-activeprofile (vla-get-profiles (vla-get-preferences (vlax-get-acad-object))) ))(setq Prof (strcase (@getActiveProfile)))(cond ((= Prof "ACADM") (princ "\nAutoCAD")) ((= Prof "VANILLA") (princ "\nAutoCAD Mechanical")) (t (princ "\nNo basic profile")))(princ))Regards HofCAD CSI.
(defun c:MechOrVanil(/ @getActiveProfile Prof)(defun @getActiveProfile () (vla-get-activeprofile (vla-get-profiles (vla-get-preferences (vlax-get-acad-object))) ))(setq Prof (strcase (@getActiveProfile)))(cond ((= Prof "ACADM") (princ "\nAutoCAD")) ((= Prof "VANILLA") (princ "\nAutoCAD Mechanical")) (t (princ "\nNo basic profile")))(princ))
(vla-get-caption (vlax-get-acad-object))
Nice idea Alan
Code: [Select](vla-get-caption (vlax-get-acad-object))
(defun woohoo2 (/ p caption) (setq caption (vla-get-caption (vlax-get-acad-object))) (if (setq p (vl-string-position (ascii "-") caption)) (substr caption 1 (1- p)) caption ))(woohoo2)