skipsophrenic Posted August 28, 2008 Share Posted August 28, 2008 If it is possible i will go away and try write it myself, just wondering, we've come across a problem at work sice upgrading from 2004 to 2008, and the only way to fix it is by opening every dwg and following steps in attatched pdf. Is it possible for a lisp routine to be written to do this and then assigned to a button of your choosing? Thanks in advance Skipsophrenic the nutter:D AutoCAD 2008 Glitch fix.pdf Quote Link to comment Share on other sites More sharing options...
dbroada Posted August 28, 2008 Share Posted August 28, 2008 firstly, I don't think you need to repeat every step in those instructions. Where it says "repeat steps x-x" you should be able to use the "previous" selection set. this should give you a clue as to how to address the problem. you need to create a selection set in either LISP or VBA - each allows you to build filters to ensure you only get the text you require. From there on it is (it seems) quite simple - not that I'm offering to do it. I have not seen this particular problem (at least not noticed it!) so I wait to see your efforts and hope I don't need it. Quote Link to comment Share on other sites More sharing options...
skipsophrenic Posted August 28, 2008 Author Share Posted August 28, 2008 all it is, is that the mtext has "Covered the drawing", with too high defined height. but still needing to do the other steps to get the drawing back (annoying) I hope nobody else needs to puzzle it out either, we think its to do with how ACAD 2008 deals with mtxt vs how ACAD 2004 does. (Why do autodesk change a perfectly good platform.) and don't worry - i'm not gonna ask anybody else to write the code for me - maybe tell me where i gone wrong, but not write it, that would be cheating - I think Quote Link to comment Share on other sites More sharing options...
dbroada Posted August 28, 2008 Share Posted August 28, 2008 creating selection sets is well covered here, do a search. You may need a little help in defining the syntax but try selecting all MTEXT first - somebody will then be able to help with the MTEXT AND bits. what language are you hoping to learn? LISP or VBA? Quote Link to comment Share on other sites More sharing options...
skipsophrenic Posted August 29, 2008 Author Share Posted August 29, 2008 this may sound crazy but i'm hoping to learn both (Not at same time though! LOL) Quote Link to comment Share on other sites More sharing options...
dbroada Posted August 29, 2008 Share Posted August 29, 2008 and have you started with either yet? The following is a bit of VBA that will select ALL MText within the drawing. I can't work out in your routine why you should select text NOT of a certain colour rather than all text - any ideas? Having made your selection set you can perform actions on that set. What I can't find is how to set "Defined Height" though. It must be possible but I can't see it. It may only be available through LISP. Public Sub BangMText() 'Dim myObject As Object Dim mySelectionSet As AcadSelectionSet Set mySelectionSet = ThisDrawing.SelectionSets.Add("MText") Dim gpCode(0) As Integer Dim dataValue(0) As Variant Dim groupCode As Variant Dim dataCode As Variant gpCode(0) = 0 'item groupCode = gpCode dataValue(0) = "MTEXT" 'item type dataCode = dataValue mySelectionSet.Select acSelectionSetAll, , , groupCode, dataCode Debug.Print mySelectionSet.Count ThisDrawing.SelectionSets.Item("MText").Delete End Sub Quote Link to comment Share on other sites More sharing options...
ASMI Posted August 29, 2008 Share Posted August 29, 2008 Deletes all not Red MText. Public Sub DeleteNotRedMText() Dim mySelectionSet As AcadSelectionSet Set mySelectionSet = ThisDrawing.SelectionSets.Add("MText") [color="Blue"]Dim filCode(0 To 3) As Integer[/color] [color="#0000ff"]Dim filVal(0 To 3) As Variant[/color] Dim cTxt As AcadMText [color="#0000ff"]filCode(0) = 0: filCode(1) = -4: filCode(2) = 62: filCode(3) = -4[/color] [color="#0000ff"]filVal(0) = "MTEXT": filVal(1) = "<NOT": filVal(2) = 1: filVal(3) = "NOT>"[/color] mySelectionSet.Select acSelectionSetAll, , , filCode, filVal For Each cTxt In mySelectionSet cTxt.Delete Next cTxt ThisDrawing.SelectionSets.Item("MText").Delete End Sub Quote Link to comment Share on other sites More sharing options...
dbroada Posted August 29, 2008 Share Posted August 29, 2008 thanks ASMI, I'll file that away somewhere. Quote Link to comment Share on other sites More sharing options...
skipsophrenic Posted August 29, 2008 Author Share Posted August 29, 2008 and have you started with either yet? The following is a bit of VBA that will select ALL MText within the drawing. I can't work out in your routine why you should select text NOT of a certain colour rather than all text - any ideas? End Sub[/code] Because that was the only way i could figure out how to select the mtext and not normal text as well, (Maybe i need a refresher cousre on cad full stop:? ) Thnks to you, the best part of the lot is all of the code that i have written so far is two lines Quote Link to comment Share on other sites More sharing options...
dbroada Posted August 29, 2008 Share Posted August 29, 2008 using QSELECT you can select MTEXT from the Object type and use an operator of select all. Quote Link to comment Share on other sites More sharing options...
dbroada Posted August 29, 2008 Share Posted August 29, 2008 I took your instructions at face value assuming you had found them somewhere. How much of that do you actually have to do? "Defined Height" appears to be the height of the text box, not the text itself so shouldn't really "cover the drawing". Another thing, do you need to move the text by an amount? Can't you just move it by 0? Can you post a "damaged" drawing so that i can have a look as I haven't encountered this problem yet. (I do have a different one with text though) Quote Link to comment Share on other sites More sharing options...
skipsophrenic Posted August 29, 2008 Author Share Posted August 29, 2008 i'll have to wait untill i get home 'cos i havent got a copy here at work at the moment. (Wish i had) and unfortunately i didn't find those instructions, i was asked to type them up so as could be distributed around our office RE: QSELECT comment NOW I FEEL DAFT!!! one of basic things i should have known! Quote Link to comment Share on other sites More sharing options...
skipsophrenic Posted August 29, 2008 Author Share Posted August 29, 2008 this is a section of the problem drawing I was on about problem.dwg Quote Link to comment Share on other sites More sharing options...
dbroada Posted September 1, 2008 Share Posted September 1, 2008 ok, a lot of what you are doing is not needed. I assume you are trying to get rid of the vertical "stripes" created by the MTEXT? How about: select all MTEXT (QSELECT) set defined height = 0 (use properties) save drawing Next time you open the drawing it will have done all the regeneration needed. Quote Link to comment Share on other sites More sharing options...
skipsophrenic Posted September 1, 2008 Author Share Posted September 1, 2008 ok, now i feel dumb, thnx 4 remindin me the quick way dbroadba, (i always overcomplicate things - that what said in last review anyway) Quote Link to comment Share on other sites More sharing options...
rookie37 Posted September 4, 2008 Share Posted September 4, 2008 (Why do autodesk change a perfectly good platform.) I have been the same for years. However, changes are a neccesary evil If it didn't update it would die out. My acad skills become redundant When it updates, My acad skills become redundant Quote Link to comment Share on other sites More sharing options...
skipsophrenic Posted September 11, 2008 Author Share Posted September 11, 2008 FOUND THE PROBLEM! The background mask in mtext was set to somethin RIDICULOUS, after qselecting everythin, i just turned off the background mask, and problem go bye-bye 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.