4o4osan Posted February 11, 2019 Share Posted February 11, 2019 Dear All, I've been able to achieve incredible things with lisp routines, tanks to you and this forum! Now I am facing another simple, but extremely time consuming activity which I am trying to speed up with a lisp code. We have few hundreds of final charts of a pipeline in which the long profile view was generated with another autodesk add on (Autochart) as an xref block. The block is stored in a separate folder and consists of few profile lines representing the pipe, meanseabed etc. There are straight lines representing the horizontal and vertical grid and they are all with default colour black and continues linetype The challenge now is to change the grid line colour and linetype to the one which are required by our client standards and they are different than the default black/white colour and continues linetype and the horizontal has to be for example DASHED and the verical DASHDOT, both grey. I have some lisp codes combined which were working well and I was able to open list of selected drawings or folder with drawings and work with them as DBX objects changing the block attributes. So now I can make a list of drawings, for each drawing of the list, I can open and close , change globally the linetypes of layers (with vla-get-layers, vla-get-name...) , colours of blocks, but seems like I can't select only lines based on the 'Angle property 0 or 1.574 rad (PI) and change the colour and linetype using the vla or vlax commands. I can perform the ssget selection set inside of each drawing and filter and edit the objects, but then I need to really open them one by one. If will try to post some codes tommorow, because I am out of the office, but this thing is really making me crazy. Any help will be highly appreciated. Quote Link to comment Share on other sites More sharing options...
Roy_043 Posted February 11, 2019 Share Posted February 11, 2019 You indeed cannot use ssget in the context of ODBX. But every line has an Angle property. Based on its value your code can decide what to do. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 12, 2019 Share Posted February 12, 2019 (edited) Using a script is not as painfull as it sounds it will open, modify and close/save dwgs pretty quick. As there is no user input. You will need a lisp etc as part of the script. Edited February 12, 2019 by BIGAL Quote Link to comment Share on other sites More sharing options...
4o4osan Posted February 12, 2019 Author Share Posted February 12, 2019 Thanks for your answers. Open/close and run the simple ssget filter and change property will be easier indeed. But isn't it there a way to make a selection based on angle/type/colour property using vla function? Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 12, 2019 Share Posted February 12, 2019 (edited) The angle of a line is a property so you can get angle, you can use a rounding factor to check if its 0.0 or 90. other way (setq ang (angle (vlax-curve-getstartpoint obj)(vlax-curve-getendpoint obj))) (if (= (vla-get-objectname obj) "AcDbline")(alert "line found")) Edited February 12, 2019 by BIGAL Quote Link to comment Share on other sites More sharing options...
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.