Charpzy Posted February 16, 2023 Posted February 16, 2023 I've made a bit of a mistake when creating multiple blocks, I put the insert point at the wrong place (i'm about 200+ blocks deep into it now). what makes it harder to change each block is in a different file, which in then in sub folder for another script to easily pull them is it possible to create a script to run so it can go through all the files/ folders and change the insert point rather than manually going through each one and changing them? this would be a huge time saver if possible Quote
hosneyalaa Posted February 16, 2023 Posted February 16, 2023 Hi Looking at this http://www.lee-mac.com/justifybasepoint.html 2 Quote
Steven P Posted February 16, 2023 Posted February 16, 2023 The batch part is easy - look at Lee Macs site, or Scriptpro Hosneyalaa has a good solution... if you are going through the files one by one but not sure if that would work for a batch. How are your block references saved? If you could post a sample drawing then we can see what needs to be done. Also if you can say whether al the base points will be the same point (for example, the origin 0,0,0) or relative to a part of the drawing. Last question, you do mean base point and not moving all the parts of the block so that the required base point is actually at the origin of the block Trying to work out the rules you need to follow, so that a LISP can do the work... get it to work on one drawings.. and it should work on them all Quote
Charpzy Posted February 20, 2023 Author Posted February 20, 2023 Hosneyalaa solution, Lee Macs base point tool will do the trick ill just have to manually do all blocks, thanks I've realised though that because I've used some of the blocks in other drawings and templates, when I insert them into that file again the base point doesn't changes I have to remove the block reference and reinsert. essentially what I'm making is a tool which inserts a block with a leader to it for a label, but at the moment I've got the leader inserting to the insert point of the block, how could I get the centre point of a block so I can draw a leader/ line from that point? Quote
devitg Posted February 20, 2023 Posted February 20, 2023 22 minutes ago, Charpzy said: how could I get the centre point of a block so I can draw a leader/ line from that point? (VL-LOAD-COM) (SETQ E (SSNAME (SSGET "_:S+." '((0 . "insert"))))) (VLA-GETBOUNDINGBOX (VLAX-ENAME->VLA-OBJECT E) 'LL 'UR) (SETQ LL- (VLAX-SAFEARRAY->LIST LL)) ; low left xyz point (SETQ UR- (VLAX-SAFEARRAY->LIST UR)) ;up rigth XYZ point (SETQ LL-ID (MAPCAR '/ (MAPCAR '+ LL- UR-) '(2 2 2))) ; the blockreference central point 1 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.