How to NOT supress the positive (+) symbol in numbers?

alexandresynth
Enthusiast

How to NOT supress the positive (+) symbol in numbers?

alexandresynth
Enthusiast
Enthusiast

Hello, i am doing a topography project and in this type of project we need to demonstrate how much earth we add how much need remove, and the symbol of positive (+) and negative (-) as prefix of the numbers are obligatory, well, the negative always appears automatically as long as the number is negative, but if the number is positive the AutoCAD just supress it and does not show.

 

I have many formulas, tables, blocks and attributes with these numbers where the fields are filled up automatically, but the plus symbol i need to add manually because autocad does not show the + symbol when the number is positive.

1.png

2.png

3.png

   

How can i fix it?

0 Likes
Reply
Accepted solutions (1)
1,475 Views
16 Replies
Replies (16)

RSomppi
Advisor
Advisor

It's common knowledge that the positive symbol is understood for non-negative numbers. It is not suppressed and is probably hard coded. You will need some sort of coding, if it is even possible.

0 Likes

alexandresynth
Enthusiast
Enthusiast
Understand and agree with you in general context, buttttttttttttttttttttt in the topography project i need show in tables the symbol of plus (+) followed by the amount number of the symbol of minus (-) followed by its amount, its obligatory.

I can add it manually inside blocks attributes changing one by one, but in table situations i cant, if i add anything else but the formula the formula is just broken and does not show the result no more.

I've been wondering if there was a way to add a "field" that display if the number is positive or negative, i didnt find it tho, but even if i did found it would solve my problem with the positive numbers but would repeat the negative symbol in negative numbers....but i didnt find a "field" that could show this information anyway...

The other part of the problem that perhaps is easier is solve the problem of the suppresion of the (+) symbol in simple table formulas, it is exactly like in Excel, if there is a way to display the plus (+) symbol in excell and not supress it it might works in AutoCAD too.

Lets continue trying to find the solution...
0 Likes

ВeekeeCZ
Consultant
Consultant

Post a dwg sample of all types of entities you use.

FIELD has a prefix format, so there could be +. Not sure how about tables.

Anyway... post dwg to take a looksee what could be done about it.

0 Likes

alexandresynth
Enthusiast
Enthusiast

Prefix would not help because not everytime the number is positive, i already thought about using it.

 

0 Likes

RSomppi
Advisor
Advisor

Have you looked at Civil 3D to see if that is a feature? It's a trade specific need and software designed for that trade would be more likely to be able to do it.

0 Likes

ВeekeeCZ
Consultant
Consultant

Well, the prefix cell format is definitely the way to go.

The idea is to write a lisp routine that you would use a window selection to select possible targets and it would read each selected value and if it's positive it will add the prefix formatting if is not already there.

0 Likes

alexandresynth
Enthusiast
Enthusiast

Yea i also thought it would work...

It really makes sense and is in conformity with how it is done in Excell to solve the same problem as u can see in the imagem below.

 

4.png

 

But in Autocad at least until now i was not able to reproduce it.

0 Likes

Valentin_CAD
Mentor
Mentor

@alexandresynth ,

 

Look into the following LISP:  PSfixTxt and srxText

 

You may need to use the Explode or Burst commands for certain object/types, which will eliminate the option to extract information with DataExtraction. (May want to copy your files before performing)

 



Select the "Mark as Solution" if my post solves your issue or answers your question.

Seleccione "Marcar como solución" si mi publicación resuelve o responde a su pregunta.


Emilio Valentin

ВeekeeCZ
Consultant
Consultant

@ВeekeeCZ wrote:

Well, the prefix cell format is definitely the way to go.

The idea is to write a lisp routine that you would use a window selection to select possible targets and it would read each selected value and if it's positive it will add the prefix formatting if is not already there.


 

Possibly something like this. Not auto-updating, needs to be re-applied.

 

(vl-load-com)

(defun c:Cell+ ( / _hit-test tb p1 p2 c1 c2 r c)
  
  (defun _hit-test (pt obj / vd)  ;; by pbe
    (setq pt (vlax-3D-point (trans pt 1 0))
	  vd (vlax-3D-point (trans (getvar 'VIEWDIR) 1 0)))
    (if (eq :vlax-true (vla-hittest obj pt vd 'row 'col))
      (list row col)))
  
  (if (and (setq tb (vlax-ename->vla-object (car (entsel "\nSelect a table: "))))
	   (setq p1 (getpoint "\nSelect cells, first point: "))
	   (setq c1 (_hit-test p1 tb))
	   (setq p2 (getcorner p1 "\nOther point: "))
	   (setq c2 (_hit-test p2 tb))
	   (setq r (1- (min (car c1) (car c2))))
	   )
    (repeat (1+ (abs (- (car c1) (car c2))))
      (setq r (1+ r)
	    c (1- (min (cadr c1) (cadr c2))))
      (repeat (1+ (abs (- (cadr c1) (cadr c2))))
	(setq c (1+ c))
	(if (not (vl-position (substr (vla-gettext tb r c) 1 1) '("+" "-")))
	  (vla-setcellformat tb r c (strcat "%ps[+,]" (vla-getcellformat tb r c))))
	(if (vl-position (substr (vla-gettext tb r c) 1 2) '("+-"))
	  (vla-setcellformat tb r c (vl-string-subst "" "%ps[+,]" (vla-getcellformat tb r c)))))))
  (princ)
  )

http://www.lee-mac.com/runlisp.html 

alexandresynth
Enthusiast
Enthusiast

List is not the ideal way but is better than nothing, i use some lisps once in a while, but the problem is the idea of explode something, i dont like it, it would be better if AutoCAD just had a way to do it simplier like Excell does. But yea, i discoveried it does not... Thank all you for helping.

0 Likes

richard_387
Advocate
Advocate
Accepted solution

@alexandresynth wrote:

Hello, i am doing a topography project and in this type of project we need to demonstrate how much earth we add how much need remove, and the symbol of positive (+) and negative (-) as prefix of the numbers are obligatory, well, the negative always appears automatically as long as the number is negative, but if the number is positive the AutoCAD just supress it and does not show.

  

How can i fix it?


 

By using Civil 3D.  which includes a procedure to set up Cut/Fill grid ticks over the area.

This picture is from a project I did using Land Desktop. I am sure the same procedure is available now.

 

cut-fill.PNG

RSomppi
Advisor
Advisor

It's a lot easier when you use a tool designed for that type of thing than it is to force a generic tool to do trade specific tasks.

0 Likes

alexandresynth
Enthusiast
Enthusiast

In general i agree with the idea, but i am not trying to do anything very specific of topography, i just want the simple plus symbol not be supressed before the numbers. Excell have it, i hope new versions of AutoCAD have this added.

0 Likes

alexandresynth
Enthusiast
Enthusiast

Thank you very much, i will download this software!

Can you tell me where inside autocad civil 3D what command did u use to do it?

0 Likes

RSomppi
Advisor
Advisor

You're welcome. I suggested C3D in message #6. It's the right tool for the job.

0 Likes

richard_387
Advocate
Advocate

I should point out that I worked on that project (pictured) 14 years ago, and the working of Land Desktop is different to Civil 3D. You should seek guidance from a current user.

 

In Land Desktop, I used the Terrain Model Explorer where I set up two surfaces (Original Ground Level and Finished Ground Level) which were combined to form a Stratum. Once you have that, then under Grid Volumes, Grid Volume ticks can be created. But I expect even the words used nowadays will have changed.

0 Likes