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: 

Renumbering Points

82 REPLIES 82
SOLVED
Reply
Message 1 of 83
kevinsbane
12168 Views, 82 Replies

Renumbering Points

What I wish to do is to assign a set of points a sequence of point numbers (or custom properties) of my choosing. For example, I have the following points:

 

100

102

104

105

107

I wish to assign point 100 -> 1000, 105 to 1001, 107 to 1002, 104 -> 1003, and 102 ->1004. Basically, I am looking for a command or utility that implements the "TCOUNT" (using select-order) command, but for Cogo points instead of text. The renumber points command appears to only work with offsets, and does not eliminate gaps. I can sequence the points if I select the points I want, then copy them -> set duplicate points to sequence from the range I choose, but this does not allow for reordering of point numbers. I tried individually selecting them in the order I wanted, but didn't change the order in which they were numbered.

 

Alternatively, I can leave the point numbers the same, and assign a user defined property that I can use to sequence the points in the order of my choosing. However, I'm not sure how to go about assigning the sequence I wish short of typing in each value individually; obviously non-ideal.

 

A third possibility that presented itself to me was to create new, correctly sequenced points that overlap exactly with the old ones, and then somehow merge the two sets together. Would there be a way to merge the old points and the new ones based on the fact that the two points have the same X-Y coordinates? Preferably done in CAD itself; the last resort would be to export both sets of points out to excel, then do some fancy manipulation in excel, then reimport into CAD.

82 REPLIES 82
Message 21 of 83
kevinsbane
in reply to: Jeff_M

I've been using this command for a while now (thank you again to Jeff!) but now that I've upgraded to Civil 3D 2013, I'm getting an error;

 

"; error: bad argument type: stringp nil"

 

Any help would be appreciated.

Message 22 of 83
Jeff_M
in reply to: kevinsbane

Open the lisp file using either Notepad or the VLIDE inside C3D. Find the section of code that looks similar to this, then make it look exactly like this (add a few lines so it finds C3D2013).

(setq	verstr (cond ((vl-string-search "\\R18.0\\" prod)
		      "7.0"
		     )
		     ;;2010
		     ((vl-string-search "\\R18.1\\" prod)
		      "8.0"
		     )
		     ;;2011
		     ((vl-string-search "\\R18.2\\" prod)
		      "9.0"
		     )
		     ;;2012
		     ((vl-string-search "\\R19.0\\" prod)
		      "10.0"
		     )
		     ;;2013
	       )
  )

 Save it then reload.

Jeff_M, also a frequent Swamper
EESignature
Message 23 of 83
kevinsbane
in reply to: kevinsbane

Jeff, I've modified the lsp as per your instructions, and am now getting the following error:

 

; error: "no applicable method for:" (QueryInterface nil)

Message 24 of 83
Jeff_M
in reply to: kevinsbane

Kevin, which version of the lisp have you been using, the original I posted or the one modified by Gavin?

 

Attached is Gavin's version updated to work in 2013.

Jeff_M, also a frequent Swamper
EESignature
Message 25 of 83
kevinsbane
in reply to: Jeff_M

My thanks. I had been using yours, but this one works well.

Message 26 of 83
gjrcmb
in reply to: kevinsbane

Hi folks,

 

I revised the reorderpoint.lsp program to work with C3D 2014 as well as 2010-2013, which appears to be a slightly different version than the one last posted by Jeff, so I can't tell you what the exact difference is.  Also fixed a shortcoming and a bug.  As always please test it out to make sure it is doing what you would expect and use at your own risk.

 

Gavin

Message 27 of 83
kpadgett606
in reply to: gjrcmb

Thanks so much to you all! This worked perfectly, version 2013.  You guys rock!

Message 28 of 83
hmartinez5
in reply to: kpadgett606

Anybody has a LSP to do this in 2015?

Message 29 of 83
gjrcmb
in reply to: hmartinez5

Hi hmartinez5,

 

Unforetunately, I don't have access to C3D 2015 to test out a modification for C3D 2015.  The lsp file needs to be updated to take into account the software version numbers for 2015.  Similar to what Jeff had described a few posts before, you can modify the lsp file to include the 2015 version numbers.  I have shown the subject portion of the file below that shows the new code to add in orange.  Hopefully this will get things working for you, but I am unable to verify on my end.  Please test it out and confirm that works.

 

 

    (setq verstr (cond ((vl-string-search "\\R18.0\\" prod)
              "7.0"
             )
             ;;2010
             ((vl-string-search "\\R18.1\\" prod)
              "8.0"
             )
             ;;2011
             ((vl-string-search "\\R18.2\\" prod)
              "9.0"
             )
             ;;2012
             ((vl-string-search "\\R19.0\\" prod)
              "10.0"
             )
             ;;2013
             ((vl-string-search "\\R19.1\\" prod)
              "10.3"
             )
             ;;2014
             ((vl-string-search "\\R20.0\\" prod)
              "10.4"
             )
             ;;2015
        )
    )

 

 

 

Message 30 of 83
hmartinez5
in reply to: gjrcmb

Thanks for the information. It looks like it loaded correctly but I can't run the command, I get the following error.

 

; error: "no applicable method for:" (QueryInterface nil)

 

Message 31 of 83
gjrcmb
in reply to: hmartinez5

Well, as I said, I don't have C3D 2015, so I can't verify or troubleshoot on my end.  If no one else responds by tomorrow, I'll see if I can try it out with the a trial version of C3D 2015.  No promises, its possible that there is more going on with the code in relation to the new software version then I have time to troubleshoot.

Message 32 of 83
Pointdump
in reply to: gjrcmb

gjrcmb,

 

The trial version of C3D 2015 is good for 60 days. What are you waiting for?

 

Dave

Dave Stoll
Las Vegas, Nevada

EESignature

64GB DDR4 2400MHz ECC SoDIMM / 1TB SSD
NVIDIA Quadro P5000 16GB
Windows 10 Pro 64 / Civil 3D 2024
Message 33 of 83
Jeff_M
in reply to: gjrcmb

Attached is an updated version, tested OK in C3D2015.

Jeff_M, also a frequent Swamper
EESignature
Message 34 of 83
hmartinez5
in reply to: Jeff_M

Jeff,

 

I keep getting the same error. I tested it on two different stations with C3D 2015 and receive the exact same error.

 

; error: "no applicable method for:" (QueryInterface nil)

 

Message 35 of 83
Jeff_M
in reply to: hmartinez5

You made sure to overwrite the old with the new one I just posted? And loaded the new version? That error is one I don't recall ever seeing in any lisp, so not at all sure what the problem might be. As I said, I tested it here and it works just fine.

 

 

Jeff_M, also a frequent Swamper
EESignature
Message 36 of 83
Jeff_M
in reply to: Jeff_M

OK, I just duplicated that error. I ran the command in adrawing which contains no points and got the (QueryInterface nil). So, make sure you have a drawing with points in it in order to use the command ReorderPoints....

 

If you are trying it in a drawing WITH points, could I see the drawing to duplicate what you are getting here?

Jeff_M, also a frequent Swamper
EESignature
Message 37 of 83
Jeff_M
in reply to: Jeff_M

Attached is a new file which includes code to warn the user that no points exist and exits cleanly when that is the case.

Jeff_M, also a frequent Swamper
EESignature
Message 38 of 83
gjrcmb
in reply to: Jeff_M

Hey Jeff,

 

I appreciate you jumping in and clearing up the situation.  Kudos to Ross Dunkley as well.  Glad to see that folks are actually using the app and finding it useful.

 

Cheers,

 

Gavin

Message 39 of 83
gjrcmb
in reply to: gjrcmb

If I am understanding things correctly, nice additions to the application to make it version independent and more robust.  Awesome.  Thanks again.

Message 40 of 83
Am_enk
in reply to: wfberry

I am using Civil 3d 2014 and get an error too 'error: bad argument type: stringp nil'

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

Post to forums  

Rail Community


Autodesk Design & Make Report