broncos15 Posted October 6, 2015 Author Posted October 6, 2015 The brackets are unbalanced like me type too. quick (Strcat "\" "deg" "\" ) BigAl, what does that mean? Quote
broncos15 Posted October 27, 2015 Author Posted October 27, 2015 Hi broncos15,perhaps something like this (vl-load-com) (defun c:demo (/ blk path sel) (if (and (setq sel (entsel "\nSelect a Xref: ")) (setq blk (vlax-ename->vla-object (car sel))) (vlax-property-available-p blk 'Path) (setq path (vla-get-path blk)) ) (vla-activate (vla-open (vla-get-documents (vlax-get-acad-object)) (strcat "\"" path "\"") :vlax-true) ) ) (princ) ) Hope this helps, Henrique Henrique, I am trying to make a slight modification to your code. My issue is when I am trying to open an xref with a relative path. My solution seems like it is much more complicated than it needs to be. It involves using the -xref command and making the path absolute for the selected xref, then making it relative after the open read only has occurred. (command-s "._xref" "_t" blk "_F") Then after the vla-open portion doing: (command-s "._xref" "_t" blk "_R") Is there an easier solution? Quote
hmsilva Posted October 27, 2015 Posted October 27, 2015 Hi broncos15, I dont have AutoCAD is this laptop, but try to add (and (setq sel (entsel "\nSelect a Xref: ")) (setq blk (vlax-ename->vla-object (car sel))) (vlax-property-available-p blk 'Path) (setq path (vla-get-path blk)) (setq path (findfile path));<<<<<< ) Henrique Quote
broncos15 Posted October 29, 2015 Author Posted October 29, 2015 Hi broncos15,I dont have AutoCAD is this laptop, but try to add (and (setq sel (entsel "\nSelect a Xref: ")) (setq blk (vlax-ename->vla-object (car sel))) (vlax-property-available-p blk 'Path) (setq path (vla-get-path blk)) (setq path (findfile path));<<<<<< ) Henrique Henrique, thank you so much for your help! Your way is much more efficient than mine. It will be useful to know this for future codes as well, so thanks for the help! Quote
hmsilva Posted October 29, 2015 Posted October 29, 2015 You're welcome, broncos15 Glad I could help Henrique Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.