GerryT

Members
  • Posts

    422
  • Joined

  • Last visited

Everything posted by GerryT

  1. My comments: 1. you are correct in your understanding 2. the problem with weights of ?.75 is that you are using a precision of 2 which will usually round up/down on .75. Try a higher precision (4)? Also the in_conv method should take two arguments, the last one being the precision. Change the 2 in the formula to the precision input and you can quickly set the precision for anything you want. --- My mistake for not catching this. 3. lbl = ' ' in simply an initializer which is necessary to tell Ruby that it is a string. needed to use the concat method. space is not needed. lbl = '' (two single quotes) Not sure I answered all your questions. A phone call or a goto might help if you need? EDIT: For your conditional try -- depth.to_i != (13 && 24 && 36) -- is that clearer? Be careful of precedence - use parentheses for grouping conditions As to the error messages -- Ruby is acknowledged to have the worst error messages. It often gets confused and does not drop previous error messages. Generally look at those near the bottom of the list. if it get really bad, just save, close and reopen
  2. Consider a left to right label build based on your criteria. Let me know if you need to rework anything?? evo_r.json
  3. I think your macro could be greatly simplified and made easier to read/understand but i also think you now have several potential conflicts now-- hard to tell what you intend. If you could define what codes are to be used for each type/condition and under what conditions/dims dims are to be added and which? Would help greatly. The secret to a good code snippet is not to just start writing but have a clear spec of what you want to accomplish first. What I got: 1. B = Base Cabinet 2. W = Wall Cabinet 3. Sink = SR 4, Tall = U 5. 2 = width > 24 6. depth of 13 == Wall Base 7. Other dim criteria which is not clear and seems to overlap others? 8. dims on end of label string are dependent on what criteria to be shown?
  4. 1. Turn on Wall labels 2. Select wall and open DBX 3. select label tab than "specify label" 4. select in "object_specific" -- %wall_id% Do this for each wall or select all together Wall ID will be the same as in Recheck XML file
  5. Chief does support Unicode characters but only through the alt key on windows or the option key on a mac. On a mac you first have to enable the Unicode char set. Also only a few fonts support the upper superscripts beyond 3. Arial is one. You can not use a macro because Chief will not accept characters from Ruby beyond the ASCII range. This feature has been requested but rejected by Chief. Codepoints are: 0- U+2070 1- U+00B9 2- U+00B2 3- U+00B3 4- U+2074 5- U+2075 6- U+2076 7- U+2077 8- U+2078 9- U+2079
  6. it's called regex expressions and is common to all recent programming languages. Ruby just does a better job at implementing it. If your interested take a look at "The bastards book of Ruby" available on the Web. Fairly straight forward stuff.
  7. x.to_s.sub(/^(-)?0\./,'\1.') where x= your number as in(-0.7500 Also handles negative numbers. Also returns a string since all floats in Ruby are defined with a leading digit.
  8. No problems so far except, I noticed my cursor is slow to initially load and locks up for a short initial period. But I believe I need to update the Logitech driver which I will do later.
  9. The windows fonts are under C:\windows\fonts Just copy and paste to a mac folder. I believe fonts on the MAC must be installed -- Use Font Book which is in your applications folder.
  10. On Mac systems, these fonts are embedded with the Chief Architect installation but not installed on the system. As such, they are available for use in Chief Architect but not in other programs. You can copy the font from a PC and install them on a MAC using Font Book. Not sure if this violates any copyrights -- Check Tech Support.
  11. I guess Glen was so determine to make his point that he forgot to actually watch the video(s) in which all the above was answered. But it was a good point. For those that caught another issue, you do not have to only use line_weights as a identifier, particularly if you have to use and turn them on later. You can also use: pattern_angle, pattern_spacing, or line_styles. I use custom line_styles as a means to name a target areas as in the line style name --- "Recreational area" ( the line pattern is the same as straight or still could be anything you want) and use the other fields to identify subsections of that area. No need to remember number codes and output is self evident with minimal coding. Very helpful if you need to separate identical objects by location -- front yard/back yard. You can also now use the object_type attribute to encompass many different objects and listings with just one macro - "one size fits all" thing. And I would say that if your macros need be 200+ lines long, your doing something wrong. These are all ten minute additions that Chief has made over the course of FIVE YEARS since X3. Much more could be done, but many are just not open minded to learning a new approach to working smarter and to the extent of not even taking advantage of what is freely offered. Some seem to be intimidated that others might incur an advantage and seek to slow progress. I expect the same thing happened with the transition from hand drafting. It, indeed, is always the younger generation to see the advantage of new trends. Having said all that, I do agree with Glen, that Chief does not want to lead in this area, and attempting to use a feature actively discouraged by them may be a futile endeavor if other options or software are available for now. IMNOHO-- this is the case, as Chief is emphatically closed minded in listening to suggestions to to make macros productive with even little effort on their part. Preferring to address only the suggestions of those who chose not to understand the technology. That's a very, very old management trick to derail a promising trend and protect the "old guard". I'll continue to help those that want help but do agree with most here that macros in Chief are 'generally' counterproductive as implemented now. But the trend is changing (BIM)-- just not at Chief.
  12. interesting -- summing areas is one of the easiest things to do in Chief Here's a video that might point you in the right direction http://www.youtube.com/watch?v=NgWxXHnb1eI
  13. i have little experience with 3Skeng but some. I regard it as one of the best piping/hvac plug-ins out there outside of Bentley/ Microstation. i don't think it is practical to bring in a Skecthup design other than as a separate view, as the bounding box would be too large to work with and you can not break up the Sketchup components as it is then just one symbol. It would be nice if you could do a overlay with a transparent background but don't know it that is possible. You could bring in the individual components from Sketchup and build a library in Chief, but then you would have the same problems that Chief's spiral piping has. Symbols have no snap points in Chief so if you get off the grid, it is very difficult to align them, particularly in 3D. And Chief has been totally close minded about listening to problems in this area, so don't look for any relief. Yes, it can be done, but don't believe you could ever be competitive trying in Chief. Stick with Sketchup -- IMNOHO. And for you Ruby nay Sayers, 3Skeng is written in Ruby as a standard ruby plug-in, so it's a good indication of what is possible if Chief would only extend ruby and open up data access in Chief. OTOH- take a look at 3Skeng's pricing structure -- it's a "killer".
  14. Video demoing the process - again 6 vs 1/2dozen http://www.youtube.com/watch?v=LzqO3vIWJVA
  15. Todd: Did a video on just that about two years ago -- result is that there is no native capability in Chief but can be done using macros and slices. Final result -- like most macro usage in chief -- was that it's more trouble than worth. -- Use a external cut/fill software.
  16. i'd start over The terrain should ALWAYS be on the first floor. Set the terrain and the features. Then draw in first building - order not real important draw second building and slab -- it will be shown below the terrain since everything start at 0 by default. then remove default locks and add a plus ?? (ex. 0 +400) to the floor level field. this will raise the second building to the level you want. will do a goto if you want?
  17. So as I understand your code it's the same as: if referenced ? obj = referenced else obj = owner end but just in a single line of code. Yes - but without the question mark
  18. Ruby in Chief can only read a text file, which you can do using the Ruby IO or FILE class. (google ruby File class) Natively, Ruby can also read any Sqlite DB (which is used by Chief) but Chief has chosen to not include that feature in the version of Ruby that they created. I believe Joe has a macro to do as you asked but it's simple enough to do yourself. Do some research on File.open in Ruby and if you have any trouble, just e-mail me and I'll walk you through it. Just create a CSV file and everything else is just one/two lines of code., However you can NOT write to the Chief data fields such as Project Name , etc. since ruby macros in Chief only read attributes. If you input that info, it must be located/stored in ruby's global memory ($...) which you can then retrieve directly via another macro and print that to a text box.
  19. I'm afraid i might only add to the confusion , but here goes. referenced and owner in Chief and in ruby are not classes (objects). They are simply methods in the top main ruby work-space. They return a derived class from NVPublisher (empty class). They then add several instance_methods to that derived object corresponding to the attributes Chief wants to make available for the object selected. Each added method, of course, as created by Chief, contains the address of the selected object on the "C" side that Ruby interfaces with. So if nothing is selected, nothing can be referenced, so the method must return a nil. In the conditional above a nil is always false and anything else (including 0) is true. So if referenced returns a object it is evaluated as true and the first statement is executed, if a nil is returned, nothing is selected and a false is returned meaning reference is not used so owner must be. if nether is selected both will return a nil but it doesn't mater as a exception will be throw on a nil reference.You could use the same statement above by testing for owner and just reverse the conditionals. Since the methods return a object, you simply set a variable to that object, because in Ruby all values (most) are returned by reference not value. Using the equivalence is the same as using the original object. This is also the bases of my video which describes how to address any object even though it is not selected and outside of a label. Once you have the UUID, it does not change,so you can address the object outside of any label or reference. The problem is if you try to address a deleted object. you will address some deleted memory and Chief will throw a C exception. They have refused to fix this as I expect they simply don't want people using attributes outside of labels. This is also why Doug said a while back that adding any attribute will only take one/two lines of code per attribute. The UUID of the object is always passed back so the only thing needed is the name of the attribute which I suppose on Chief's end is just a lookup table or perhaps a hard coded pointer. This is why I always said that all DBX data is already available to us. If Chief would simply pass back the entire object dataset as pointed to by its UUID instead of individual attributes, we would have all the info by just unpacking the data ourselves. Ruby is a ideal language to do this and very simple to do. Chief need only publish the format of their stored dataset for each object. Their aren't that many object types in Chief to be a burden, and no need to write code for every new attribute or revision. BTW, I believe the original developers anticipated doing something like this in some future release but for reasons still unknown were pulled off the project. Clear as MUD?
  20. You won't find any documentation in Chief -- Just a standard conditional statement in most languages. Take a look at the "little book of ruby" And your right, only error trapping returns the error message but you can also use the "evaluation error" button in the MM DBX. I don't bother printing error messages as RUBY is considered the worst language in analyzing/issuing descriptive error messages. Mostly wrong with complicated scripts.
  21. Joe: I discovered that one several years ago but haven't used it in some time now. A more compact version is: referenced ? obj = referenced : obj = owner # Then add your code using obj or whatever obj.area.round(2) It has the advantage is not using the error catch in case you have to use it later giving cleaner code. Also only one line at the top of every macro. enjoy.
  22. Joe: I'm tired of this nonsense, been more than fair. - I'm done here. Those that legitimately want help know where to find it otherwise??
  23. All the data shown in my videos was 100% correct and accurate. I went to great care to double check that. However, almost every field was defined and calculated differently which was my thought that such complexity is required because few work consistently in the same district. I needed to demo that capability as seamless too and straight forward. Wishing you great success on your release. It can only be helpful to the cause and maybe more appropriate to those here.
  24. "By Jove , I Think You Got It?" Still offering gotomeeting so you can make a more informed judgement--BTW I don't think Chief is interested in anything in this area for X9 - thus the videos -- not seen.