I am writing an AutoLisp routine that will automatically populate the bill of material from a user input. The portion that inserts the text is not behaving as programmed. As you see below, all of the coordinates and text commands are setup identically. The first four text commands behve correctly, however, the last text command is not accepting the Y coordinate (IPipeYCoor). It has been frustrating to say the least. Please have a look and provide any feedback.
(defun C:GFD (/ SubItNoPt SubItNoPt1 SubItNoPt2 SubItNoPt3
SubItNo_IPipe IPipeYCoor
DescPt1 DescPt2
PcsPt PcsPt1 PcsPt2
PartNoPt PartNoPt1 PartNoPt2
CDesPt CDesPt1 CDesPt2)
(setq SubItNoPt (getpoint "\nSelect the upper-right corner of the SUB ITEM NO. column"))
(setq PcsPt (getpoint "\nSelect the upper-right corner of the PCS. column"))
(setq CDesPt (getpoint "\nSelect the upper-mid point of the COLUMN DESIGNATION column"))
(setq SubItNo_IPipe (getint "Enter the SUB ITEM NO. for the Interphase pipe: "))
(setq SubItNoPt1 (- (car SubItNoPt) 0.06)); X coordinate for Sub Item Number
(setq SubItNoPt2 (+ (cadr SubItNoPt) 0.075)); Y coordinate Initial
(setq IPipeYCoor (- SubItNoPt2 (* 0.15 SubItNo_IPipe))); Y coordinate
(setq SubItNoPt3 (list SubItNoPt1 IPipeYCoor)); XY Coordinate for Sub Item Number
(setq DescPt1 (+ (car SubItNoPt) 0.06)); X coordinate for Description
(setq DescPt2 (list DescPt1 IPipeYCoor)); XY Coordinate for Description
(setq PcsPt1 (- (car PcsPt) 0.11)); X coordinate for PCS
(setq PcsPt2 (list PcsPt1 IPipeYCoor)); XY coordinate for PCS
(setq PartNoPt1 (+ (car PcsPt) 0.385)); X coordinate for Part Number
(setq PartNoPt2 (list PartNoPt1 IPipeYCoor)); XY coordinate for Part Number
(setq CDesPt1 (- (car CDesPt) 0.015)); X coordinate for Quantity in Column Designation
(setq CDesPt2 (list CDesPt1 IPipeYCoor)); XY coordinate for Part Number
(command "Text" "Justify" "MR" SubItNoPt3 "0.09" "" SubItNo_IPipe)
(command "Text" "Justify" "ML" DescPt2 "" "" "1\" STD. GALV. PIPE x X\'-X\" \(INTERPHASE\)")
(command "Text" "Justify" "MR" PcsPt2 "" "" "1")
(command "Text" "Justify" "ML" PartNoPt2 "" "" "16460711")
(command "Text" "Justify" "MR" CDesPt2 "" "" "XXX")
(princ)
)
Clik here to view.
Clik here to view.
Clik here to view.
Clik here to view.
Clik here to view.
Clik here to view.