乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 21|回复: 0

[编程交流] Help with simple code please;

[复制链接]

3

主题

6

帖子

3

银币

初来乍到

Rank: 1

铜币
15
发表于 2022-7-5 18:31:56 | 显示全部楼层 |阅读模式
I aim to make some quick-keys for opening frequently visited folders within my projects in windows explorer.  My AutoLISP abilities are very limited but I was able to symbol this code which works in one specific scenario.
 
  1. (defun c:PICS ()(setq PicsPath1 (vl-string-right-trim "\\Dwgs\" (getvar "dwgprefix"))) (setq PicsPath2 (strcat PicsPath1 "\\Photos\"))  (startapp "explorer" PicsPath2) (princ))
 
 
My project folder structure is basically like this:
 
  1. N:\project name\correspondences              \docs              \dwgs                   \ByOthers                   \exhibits                   \ImpPlans                            \On-Site                            \Off-Site                   \profiles              \photos              \points
 
I intended the code above to open the "\photos" folder.  All my drawing files are in "N:\project name\dwgs\" or deeper.  Deeper is where I'm having problems with my code.  It only works on drawings in "N:\project name\dwgs\" but does not work on any drawings that are deeper, say in "N:\project name\dwgs\exhibits" or "N:\project name\dwgs\ImpPlans\Off-Site".  
 
I've figured out that my code is trimming only the "\dwg" folder before placing the "\photos" folder into the path.  I need to trim "\dwg" and everything beyond it.  I think it could be something as simple as wildcard character, but after a few days of reading posts, I still have not figured this out.
 
Any and all help is appreciated!
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-12 13:28 , Processed in 0.693687 second(s), 54 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表