Manuelmfec Posted July 27, 2021 Posted July 27, 2021 Hello dear AutoCAD community, I am developing a small Autolisp routine that allows me to convert a selection of (texts with fields) into normal texts while preserving their value. The texts with fields are grouped in a table with the command "_group". The routine process would be as follows: 1) the routine allows me to select the group (the grouped table) "group1" and then filter the texts with fields according to their style in another select "group2". 2) the respective conversion is carried out. 3) Once the conversion is complete, the table and its components are regrouped in their entirety with the command "_group". End of the process. I have already tried many attempts and have not been able to get the main part of the routine (process 2). I ask you please to help me achieve the result described above, I am attaching a dwg with small examples of the tables I work with and the autolisp code that I have been able to achieve (process1 and process3). I am looking to perform this routine since these tables in my work usually have up to 100 rows and converting each text with field one by one takes a long time. Thank you very much for your attention !!!!! (DEFUN C:3XDM () (SETVAR "CMDECHO" 0) ;PROCESO1 (SETQ GRUPO1 (SSGET)) (COMMAND "_UNGROUP" GRUPO1) (setq GRUPO2 (ssget "P" '((0 . "TEXT")(7 . "MFEC2")))) ;PROCESO2 (setq LONG (sslength GRUPO2) ) ;PROCESO3 (COMMAND "_-GROUP" "_C" "*" "" GRUPO1 "") ) PRUEBA DE COMANDOS.dwg Quote
BIGAL Posted July 28, 2021 Posted July 28, 2021 (edited) My take on this task is to make "TABLE" objects as this does the grouping for you a Table supports fields. So you would have 3 tables not linework and text looking like a TABLE. So running a remove field keep value in Table is what you want. I am pretty sure that at least 1 of the generate a table of Lots/Plots already exists. If not all your required tables. I think I have seen a table with all 3 combined into 1. Need to google. Try the "Table" command. This would be one table created using a lisp. Edited July 28, 2021 by BIGAL Quote
Manuelmfec Posted July 28, 2021 Author Posted July 28, 2021 Hace 1 hora, BIGAL dijo: Mi opinión sobre esta tarea es hacer objetos "TABLA" , ya que esto hace la agrupación para usted, una tabla admite campos. Por lo tanto, necesitaría 3 tablas sin líneas y el texto se verá como una TABLA . Entonces, ejecutar un campo de eliminación de mantener el valor en la Tabla es lo que desea. Estoy bastante seguro de que ya existe al menos 1 de las tablas generadas de lotes / parcelas. Si no todas sus tablas requeridas. Creo que he visto una tabla con los 3 combinados en 1. Necesito buscar en Google. Prueba el comando "Tabla". Esta sería una tabla creada usando un lisp. Hi, thanks for your response. Yes, the goal of the routine is to remove the field and keep the value. I am going to tell you a little about what happens, the place where they make the tables, they use lisp routines to generate them and they remain like this in the "dwg" with the advantage of the fields so that they are updated every time modifications are made, when it is true that there are no modifications. . They send them to me to save them in a record, but I only take the "table" and when I do, the references and therefore the value are lost, then I have to convert each field one by one to normal texts, when there are few rows there are no no problem, but sometimes they are "tables" of up to 100 rows and it takes a long time Quote
BIGAL Posted July 29, 2021 Posted July 29, 2021 As I said for correct reference with Autocad objects they are not Tables but, Lines and text to look like the common term a Table. Quickest way would be convert to a "Autocad Table" its not that hard to read the columns of text/field, and place in a new Acad table. Do a google for this "convert column text to table autocad lisp" that is the 1st part of the answer, once solved the fields can be looked at. Quote
Tharwat Posted July 29, 2021 Posted July 29, 2021 Here is my program that I wrote a few months back to help me to strip Fields in Attributed blocks and I modified it for you to work on texts in groups. Fld2Txt.VLX 1 Quote
Manuelmfec Posted July 29, 2021 Author Posted July 29, 2021 It has served me wonderfully, thank you friend Quote
Tharwat Posted July 29, 2021 Posted July 29, 2021 55 minutes ago, Manuelmfec said: It has served me wonderfully, thank you friend You're welcome anytime. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.