Morning,
Is there a way to renumber all the points in a point group? Right now I am doing each point individually but I have many points and it would be wonderful to learn how to do that automatically. Suggestions?
Thanks
Erika
Solved! Go to Solution.
Solved by Jeff_M. Go to Solution.
HOW AMAZINGLY SIMPLE!
Thank you.
If you want to remove any gaps where numbers have been missed in the selected data I like to export my points to excel and renumber thru excel.
Thanks Rhino. I think the excel method works primarily if there are gaps in point list, not so much if points need to be inserted between 2 consecutive existing points. I presume your solution is processed as a final step?
Mishler,
I was going try my hand at either creating a lisp routine or recording a macro for doing what I describe above (adding small offset to a large point group, where the "overwrite" warning pops up). My approach for adding a 3 point "gap" would be as follows, with user input underlined:
1 - Begin with Renumber command and prompt for the point range
2 - Add a default 100,000 (plus a user input value of 3 in this example) to point numbers in this range
3 - Run the Renumber command again, referencing the point numbers of the original point range PLUS the overall offset added (100,003 in this case)
4 - Set renumber offset value to -100,000
end
So there would only be two user inputs: original point range and the number of extra point number slots needed before lowest number in range. I don't know that the macro recording can set a variable to the point range in step 3, but if I'm wrong, I'd rather go that route.
Am I on the right track?
Thanks!
Thanks for the quick reply.
I'm surprised that something like this doesn't already exist. The fact that you didn't mention one tells me that it hasn't. If the way you describe would be easier or advantageous over just outright renumbering all points the way I described, then I'll take your word for it - not that I'm about to just type out the code to do this. Maybe Sincpac has something like this.
Can lisp extract available points from ListAvailablePointNumbers? That might introduce a whole new ball of wax.
Here is a VERY quickly thrown together lisp that will bump the point numbers of a range of points. Little, to no, error checking included! To be truly useful it would need to verify that the desired bump in numbers won't be affected by existing points, as well as verify valid input was given...but I do give a method for the user to visually see which points ARE available. Use as you like....
Example usage:
Command: BUMPPOINTNUMS
Current Free point numbers: 1231,2400-2402,2423-12341,12343+
Range of points to bump (xxx-xxx): 2403-2422
Amount to change point number by (make sure new numbers are available!): 5
Free point numbers now: 1231,2400-2407,2428-12341,12343+
Jeff,
Thanks man! So, if my intention will always be to bump a range of point numbers which start somewhere in the middle and go up to the last point, the verification really wouldn't be necessary. I've been defining point groups by point ranges which are far more than I'll need, so there is very little chance that bumping numbers upward would put points in different groups. But that is pretty slick that you show the user the available points mid-stream.
I'd be willing to show my appreciation through paypal if you wanna give me an e-mail address, especially considering this isn't the first time you've done this for me.
Hey Jeff,
What exactly is going on in the code below? This was found toward the end of the script and the registry and user product key references threw up a red flag for me.
(setq verstr (strcat "HKEY_LOCAL_MACHINE\\"
(if vlax-user-product-key
(vlax-user-product-key)
(vlax-product-key)
)
)
verstr (vl-registry-read verstr "Release")
verstr (substr verstr
1
(vl-string-search
"."
verstr
(+ (vl-string-search "." verstr) 1)
)
)
C3D (vla-getinterfaceobject
*acad*
(strcat "AeccXUiLand.AeccApplication." verstr)
)
)
Thanks
Hey Jeff,
Finally getting around to testing out the lisp. It hangs a bit when invoked, but eventually shows available points. I put in a range of 50 points to be adjusted, then an additive factor of 5, and got this:
; error: Civil 3D API: The parameter is incorrect.
Is this something easily fixed?
Oops (I caught this before the forum timed out edits for this post!)
I reran it and it looks like the lisp doesn't account for the overwriting (overlapping) of points between original and adjusted, so renumbeing upward to an entirely vacant range works with the lisp, then renumbering down a smaller or larger number would as well. I suppose at this point I can just make a macro, calling on the lisp for each adjustment, unless you wanna tweak it a bit more. 😃
@bcsurvey wrote:
Hey Jeff,
......unless you wanna tweak it a bit more. 😃
Not really 🙂 There's another renumber lisp floating around thatis more robust, but involves selecting points to renumber. A similar version of that is also available in the Sincpac-C3D package. Regading the error and numbering....this is waht I included with the post where I attached the lisp "
Little, to no, error checking included! To be truly useful it would need to verify that the desired bump in numbers won't be affected by existing points, as well as verify valid input was given...but I do give a method for the user to visually see which points ARE available. Use as you like....
Example usage:
Command: BUMPPOINTNUMS
Current Free point numbers: 1231,2400-2402,2423-12341,12343+
Range of points to bump (xxx-xxx): 2403-2422
Amount to change point number by (make sure new numbers are available!😞 5"
because I knew it would error if it hit a duplicate number 🙂 But it's there to edit as you like to remove, or plan for, these issues.
Yes, you did mention that when you posted it.
What you provided is still an improvement over how I was doing it before. I'll still need to check on the point ranges that define certain point groups, but I keep a text object in model space that reflects the ranges for each group, updating it as needed, so I can have that in view when running your lisp. No problem. I'm still a bit surprised that there isn't an OOTB function that can just renumber a range starting with the high number first and work its way down. We're in the high-speed computing age, so I wouldn't think it would take more than a few seconds to do thousands of points like that, as long as number of vacant spots above or below point range is greater than or equal to the additive factor desired.
Can you recommend any tutorials off-hand for Lisp or DIESEL? I found some here: http://www.crlf.de/Dokumente/Diesel/DieselReference.html but basic examples from the ground up are what I need, not just the meaning of bits and pieces. I can't have my son one-upping me by the time he's in 6th grade!
Thanks
(sorry for the rant!)