Community
Civil 3D Forum
Welcome to Autodesk’s Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

converting metric stationing to imperial stationing

7 REPLIES 7
Reply
Message 1 of 8
sperry
1328 Views, 7 Replies

converting metric stationing to imperial stationing

I need to update metric numbers on a older CAD file to imperial numbers. Right now it is all single line text. Anyone know of a way to easily convert single line text to some format that could then be converted from metric to imperial? I have stationing, pipe sizes (in milimeter), inverts, etc. Thank-you.

7 REPLIES 7
Message 2 of 8
tcorey
in reply to: sperry

Do you just want something that will read the text, convert to a real number, convert that from meters to feet and then convert back to text? Post your drawing.

 

Tim

 



Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut
Message 3 of 8
sperry
in reply to: tcorey

That sounds like what I'd like to accomplish. Just so the numbers read in imperial, it make it easier for the field crews as they are used to imperial numbers.

Thank-you

Sonja





Do you just want something that will read the text, convert to a real number, convert that from meters to feet and then convert back to text? Post your drawing.



Tim
Message 4 of 8
tcorey
in reply to: sperry

Post your drawing so I can look at your actual text objects.



Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut
Message 5 of 8
sperry
in reply to: sperry

 
Message 6 of 8
tcorey
in reply to: sperry

Which text objects get converted? Only those that have a number followed by mm?



Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut
Message 7 of 8
sperry
in reply to: tcorey

The numbers I need changed are the stationing, inverts, and elevations. I'm going to use a legend to show piping mm conversions.

Thank-you

Sonja
Message 8 of 8
tcorey
in reply to: sperry

This code will convert the stations in plan view. This was a quick routine to write.

 

(defun ConvertStationLabelstoImperial ( / ls len ctr ent val stlen stctr str ltr strrm strri entx)

  (setq ls (ssget "x" (list (cons 8 "1STALBL")(cons 0 "TEXT")))
	len (sslength ls)
	ctr 0)

  (while (< ctr len)

    (setq ent (ssname ls ctr)
	  val (cdr (assoc 1 (entget ent)))
	  stlen (strlen val)
	  )

    (setq stctr 1
	  str "")

    (while (<= stctr stlen)
      (setq ltr (substr val stctr 1))
      (if (/= ltr "+")
	(setq str (strcat str ltr))
	)
      (setq stctr (1+ stctr)
	    )
      )
    (setq strrm (atof str)
	  strri (rtos (* strrm 3.2808) 2 0)
	  )
    ;add + back in
    (setq sufx (substr strri (- (strlen strri) 1) 2)
	  prfx (substr strri 1 (- (strlen strri) 2))
	  )
    (setq strri (strcat prfx "+" sufx))
    (setq entx (entget ent))
    (setq entx (subst (cons 1 strri)
		      (assoc 1 entx)
		      entx)
	  )
    (entmod entx)
    (entupd ent)
    (setq ctr (1+ ctr))
    
    );end while
  );end function
      
      

 

The invert elevations don't always end in a number, so I would have to check for that, and they aren't all the same precision, so I would have to check for adapt to that. That's gonna be more than I have time to do for you today. Maybe Friday...

 

 



Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report