Cad O Cad Posted October 12, 2009 Posted October 12, 2009 Just wondering if anyone out there has some code that can select a specific line within a group of lines and then change that color of that line?? Quote
Jay Dee Posted October 12, 2009 Posted October 12, 2009 Just wondering if anyone out there has some code that can select a specific line within a group of lines and then change that color of that line?? Can you clarify a little. How are the lines grouped? Why cant you just use the conventional method of selecting the line and changing its properties? If iv missed something within the question my apologies. Quote
Cad O Cad Posted October 12, 2009 Author Posted October 12, 2009 well to specify, im using a selection set....here is a sample of my beggining code: Function ChangeColorOfLayouteight(strErrors) Dim S99 As AcadSelectionSet Dim Ftyp(5) As Integer Dim errCount As Long 'Dim strErrors As String Dim Fval(5) As Variant Dim dEnd As Variant '*'************************************************************** '* Program Begins '* Looks for outer contour of LO1 Doc. to Red '************************************************************** Ftyp(0) = -4: Fval(0) = "<AND" 'Ftyp(1) = -4: Fval(1) = "<OR" Ftyp(1) = 0: Fval(1) = "LINE" Ftyp(2) = 67: Fval(2) = "0" Ftyp(3) = 5: Fval(3) = "BD8" 'Ftyp(5) = 5: Fval(5) = "BD8" 'Ftyp(6) = 5: Fval(6) = "C37" 'Ftyp(7) = 5: Fval(7) = "C36" 'Ftyp( 8 ) = 5: Fval( 8 ) = "C1F" 'Ftyp(9) = 5: Fval(9) = "C35" 'Ftyp(10) = 5: Fval(10) = "C34" 'Ftyp(11) = 5: Fval(11) = "C33" 'Ftyp(12) = 5: Fval(12) = "C32" 'Ftyp(13) = 5: Fval(13) = "C31" 'Ftyp(14) = 5: Fval(14) = "C30" 'Ftyp(15) = 5: Fval(15) = "C2F" 'Ftyp(16) = 5: Fval(16) = "C2E" 'Ftyp(17) = 5: Fval(17) = "C2D" 'Ftyp(1 8 ) = 5: Fval(1 8 ) = "C2C" 'Ftyp(19) = 5: Fval(19) = "C2B" 'Ftyp(4) = -4: Fval(4) = "OR>" Ftyp(4) = -4: Fval(4) = "AND>" 'ThisDrawing.SelectionSets("S99").Delete Set S99 = ThisDrawing.SelectionSets.Add("S99") S99.Select acSelectionSetAll, , , Ftyp, Fval If S99.Count > 0 Then For errCount = 0 To S99.Count - 1 S99(errCount).color = acWhite 'S99(errCount) = "0.03" Next errCount End If ThisDrawing.SelectionSets("S99").Delete End Function Quote
Jay Dee Posted October 12, 2009 Posted October 12, 2009 Correct me if im wrong but 'q select' is for changing multiple objects/lines with common properties. My understanding of the original question was that one line is to be changed. Quote
Jay Dee Posted October 12, 2009 Posted October 12, 2009 Cad O Cad, Im bowing out not so gracefully, I take it your involved in some sort of cad programming or whatever, I was looking at it from a draughting point of view. Good luck anyway!! Quote
Cad O Cad Posted October 12, 2009 Author Posted October 12, 2009 Jay Dee, yea i am lol..well your interest is greatly appreciated thank u ! Quote
ReMark Posted October 12, 2009 Posted October 12, 2009 Your code would have to cycle through the lines giving you the option to change its color/or not as I cannot think of a way to isolate one line from many unless it happens to be at a particular height "Z" in the drawing. Would that be the case? Quote
Cad O Cad Posted October 12, 2009 Author Posted October 12, 2009 Well what is happening is that i have a drawing that only certain lines need to be white and everything else needs to change when the rest of the program finish's. 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.