DCarpenter Posted January 30, 2013 Share Posted January 30, 2013 For the life of me, I can't figure out where to select the line type of a new class I created inside a PIO. I'm able to change the Line Style of the class with SetClLSN, The index of the dash style I want is found by using GetDashStyleIndex. Now I need to do the next step and change the class line type to the specific index number, but can't seem to find the 'Set' command I need. Any ideas? i:=GetDashStyleIndex(False,2,.005,.03); {searches/creates for the dash line index number} SetClLSN('PP- Projection Cone',-2); {sets the line style of the class to 'dash line'} Thanks in advance for your help. Dave Quote Link to comment
Miguel Barrera Posted January 30, 2013 Share Posted January 30, 2013 The variable "ls" returned below should be the index that is needed for the set function ls:= GetDashStyleIndex(False,2,.005,.03); SetClLSN('PP- Projection Cone',ls); Line styles -1 to -10 are reserved for the default styles. One thing to look for is what value does "ls" returns. If it is positive, it should be changed to negative. Quote Link to comment
DCarpenter Posted January 30, 2013 Author Share Posted January 30, 2013 Miguel, Thank you for your response. In a blank drawing template I start with two line types. When I make the changes that you mentioned above the 'ls' value is equal to -3, which makes sense since the GetDashStyleIndex will create a line type if that specific one it's looking for isn't found. Unfortunately when that same value gets processed with the SetClLSN command, The class line remains unchanged. Any ideas? Quote Link to comment
Miguel Barrera Posted January 31, 2013 Share Posted January 31, 2013 Make sure that the line inherits the class style. When you create a line in a pio, it will inherit the pio attributes as shown on the attribute palette (document attributes) when the pio is created. If you want individual objects to have a different class and attributes, you need to assign it to the object before or after it is created. I usually follow these steps to ensure class inheritance: 1. Set attributes by class (i.e. LSByClass, etc) at the beginning of the script. 2. Create object 3. Set object to the target class, as in SetClass(LNewObj,'Class name') Quote Link to comment
DCarpenter Posted January 31, 2013 Author Share Posted January 31, 2013 Thanks. I have been able to create a line (object) in my PIO and assign its attributes to be class dependent. What I'm stuck on is how to change the line type of the class to a specific class. I can find the index number of the line type I want using GetDashStyleIndex, but I just cant seem to find the command that changes the line type of the class. SetClLSN doesn't seem be doing the trick. Is there another method to do this by? Quote Link to comment
Vectorworks, Inc Employee klinzey Posted January 31, 2013 Vectorworks, Inc Employee Share Posted January 31, 2013 Does the class start off having "None" for the class style? On an off chance try setting the Class Line Style to Solid then to the line type you want. I noticed some odd behaviors in the dialog when changing form the "None" style directly to a line type. Quote Link to comment
DCarpenter Posted February 7, 2013 Author Share Posted February 7, 2013 Thanks Kevin, I'll give it a try. Quote Link to comment
DCarpenter Posted February 8, 2013 Author Share Posted February 8, 2013 OK, it works, but not really. Klinzey said it well when he said 'odd behaviors' So here's the code I'm using: i:=GetDashStyleIndex(False,2,.005,.03); SetClLSN('PP- Projection Cone',i); The first line of code finds/creates the appropriate line type and return the correct index number. The second line sets the line type of the class 'PP- Projection Cone' to the desired index line type. Further down in the code I draw a line that uses the line type on that specific class, and it draws it correctly. Everything is running correctly when I run the PIO, the line that the PIO draws is the correct line type. But when I manually check the class in the drawing after executing the PIO it shows me that the line type for that class HAS NOT changed, it's still the default line type. So I convert the PIO (which ran correctly) to a group and select the line that is drawn correctly and look at it's attributes. All the attributes are class dependent, including the line style, but when I click the line type of that line, it shows me that it is drawn with the default line type, but it's actually drawn in a specified line type from the PIO. Very "odd" indeed, but the PIO runs correctly Thanks Klinzey. Quote Link to comment
Vectorworks, Inc Employee klinzey Posted February 8, 2013 Vectorworks, Inc Employee Share Posted February 8, 2013 DCarpenter, I submitted a bug about the odd behavior I saw in the dialog. Hopefully correcting that will also fix the problem you are experiencing. Quote Link to comment
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.