Author Topic: Isometric Dimensioning Routine  (Read 2028 times)

0 Members and 1 Guest are viewing this topic.

T-Square

  • Guest
Isometric Dimensioning Routine
« on: May 16, 2014, 03:23:54 PM »
Hello All,

I have been trying to create a routine to create and run some isometric dimensioning. I have had some success, in a round about way, but can't seem to get it dialed in just right.

The code is attached in the zip file along with the isocube and the iso arrows.

I have tried switching everything around, back and forth and to and fro. Just can't seem to get it dialed in correctly.

I know I know I know...it's not to the "guru standard" of lisp writing and functioning, but if it meets the end result for me, then I am happy with it. :-)

The other, kind of a major problem with this routine is that it does not display "stacked" fractions correctly. This is a pretty big issue and the end result is the exploding of the dimension string and converting the mtext to dtext so that I can use the "special" character coded font that creates stacked fractions... i.e., %%###

Any and all help is greatly appreciated.

tedg

  • Swamp Rat
  • Posts: 811
Re: Isometric Dimensioning Routine
« Reply #1 on: May 19, 2014, 09:04:15 AM »
For me, the ISO-ARR-30.dwg was corrupt, so I needed to modify the 330 one to test it out.
I think there's something in your code that is forcing the wrong text style with the dimstyles.
 
I run your code and dimension the cube, and if I assign the proper text styles with the proper dimstyles, it seems to be ok.
**edit** I also find that it seems to use the "330" dimstyle on the all sides as well, so on the test dwg I uploaded, I needed to change some  to the proper "30" dimstyle. So you seem to have all the right stuff in your code, just needs to put it in the right place, I'll keep looking. But I am a beginner to intermediate lisper.
 
 
« Last Edit: May 19, 2014, 09:21:34 AM by tedg »
Windows 10 Pro 64bit, AutoCAD 2023, REVIT 2023

tedg

  • Swamp Rat
  • Posts: 811
Re: Isometric Dimensioning Routine
« Reply #2 on: May 19, 2014, 09:48:49 AM »
Take a look at your dimension style subroutines, you seem to have the opposite text styles assigned to them as well as you are inserting the opposite arrowhead drawing names. Although you are calling out the proper dimblk (etc). I think it works if the blocks exist in the file already.
 
Those were some of the obvious things I saw.
I bet these awsome Swampers will have better suggstions than I.
Windows 10 Pro 64bit, AutoCAD 2023, REVIT 2023

T-Square

  • Guest
Re: Isometric Dimensioning Routine
« Reply #3 on: June 23, 2014, 05:59:09 PM »
Revisiting this apparent dead horse because it is an issue that I don't have the solution for. I can enter the %%nnn code for a stacked fraction but mtext with an isometric style will not use the %%nnn codes. So, I found the attached code that will take the %%nnn and convert it. Thing is...and with the understanding I have NEVER claimed to know jack about lisp coding and such...never made time nor have I had time in all these years to wrap my head around it all.

The attached code came from one of the "unicode" gurus at Autodesk. This works for some fractions, but not all. This is a very perplexing issue for me as I see an AWFUL lot of time being wasted to produce isometric dimensions when it should...in my oppinion be much easier to produce like a simple linear dimension. I seriously dislike busted dimensions.

Any additional help...as always...is greatly appreciated.

Tim

Code: [Select]
(defun c:fixfrac (/ ss idx ename elist str new count)
  (setq ss (ssget "X" '((0 . "DIMENSION")))
        idx -1
        count 0 )
  (if ss
    (progn
      (while (setq ename (ssname ss (setq idx (1+ idx))))
        (setq elist (entget ename)
              str (cdr (assoc 1 elist)) )
        (if (wcmatch str "*%%###*")
          (progn
            (setq new ""
                  count (1+ count) )
            (while (< 0 (strlen str))
              (if (wcmatch (substr str 1 5) "%%###")
                (setq new (strcat new (chr (atoi (substr str 3 3))))
                      str (substr str 6) )
                (setq new (strcat new (substr str 1 1))
                      str (substr str 2) )
              )
            )
            (entmod (subst (cons 1 new) (assoc 1 elist) elist))
          )
        )
      )
    )
  )
  (if (/= 0 count)
    (princ (strcat (itoa count) " dimensions modified.\n"))
  )
  (princ)
)